Support Forum       G3D Web Page     
Public Member Functions | Public Attributes | List of all members
G3D::GEvent Union Reference


General low-level event structure. More...

Public Member Functions

bool isMouseEvent () const
 
Point2 mousePosition () const
 
const OSWindowosWindow () const
 
String toString () const
 

Public Attributes

ActiveEvent active
 
MouseButtonEvent button
 
CharInputEvent character
 
FileDropEvent drop
 
ExposeEvent expose
 
FocusEvent focus
 
GuiEvent gui
 
GuiCloseEvent guiClose
 
JoyAxisEvent jaxis
 
JoyBallEvent jball
 
JoyButtonEvent jbutton
 
JoyHatEvent jhat
 
KeyboardEvent key
 
MouseMotionEvent motion
 
QuitEvent quit
 
ResizeEvent resize
 
MouseScroll2DEvent scroll2d
 
uint8 type
 This is a G3D::GEventType, but is given uint8 type so that it does not call the constructor because GEvent is a union. More...
 
UserEvent user
 

Detailed Description


General low-level event structure.

Event Dispatch Overview:

  1. The OSWindow polls the operating system for events like key strokes and mouse movement, and recieves events fired by Gui and other classes.
  2. GApp::onUserInput polls GEvents from the OSWindow.
  3. GApp calls WidgetManager::onEvent for its widget manager.
  4. WidgetManager invokes Widget::onEvent for every installed widget (e.g., GuiWindow, FirstPersonManipulator).
  5. When a GuiWindow receives an event, it dispatches that event to the control that has focus if that control is inside the window (for mouse clicks, it first changes focus to the control under the mouse).

Most event processing code looks like:

switch (event.type) {
case GEventType::MOUSEBUTTONDOWN:
   ...
   break;
...
}
See also
G3D::GEventType, G3D::Widget::onEvent, GApp::onEvent, G3D::OSWindow::pollEvent.
Referenced Code: Based on libsdl's SDL_Event, which is based on X11 and Win32 events

Member Function Documentation

◆ isMouseEvent()

bool G3D::GEvent::isMouseEvent ( ) const

◆ mousePosition()

Point2 G3D::GEvent::mousePosition ( ) const

◆ osWindow()

const OSWindow* G3D::GEvent::osWindow ( ) const
inline

◆ toString()

String G3D::GEvent::toString ( ) const

Member Data Documentation

◆ active

ActiveEvent G3D::GEvent::active
Deprecated:

Referenced by osWindow().

◆ button

MouseButtonEvent G3D::GEvent::button

◆ character

CharInputEvent G3D::GEvent::character

◆ drop

FileDropEvent G3D::GEvent::drop

◆ expose

ExposeEvent G3D::GEvent::expose

◆ focus

FocusEvent G3D::GEvent::focus

◆ gui

GuiEvent G3D::GEvent::gui

◆ guiClose

GuiCloseEvent G3D::GEvent::guiClose

◆ jaxis

JoyAxisEvent G3D::GEvent::jaxis

◆ jball

JoyBallEvent G3D::GEvent::jball

◆ jbutton

JoyButtonEvent G3D::GEvent::jbutton

◆ jhat

JoyHatEvent G3D::GEvent::jhat

◆ key

KeyboardEvent G3D::GEvent::key

◆ motion

MouseMotionEvent G3D::GEvent::motion

◆ quit

QuitEvent G3D::GEvent::quit

◆ resize

ResizeEvent G3D::GEvent::resize

◆ scroll2d

MouseScroll2DEvent G3D::GEvent::scroll2d

◆ type

uint8 G3D::GEvent::type

This is a G3D::GEventType, but is given uint8 type so that it does not call the constructor because GEvent is a union.

◆ user

UserEvent G3D::GEvent::user

documentation generated on Wed Nov 24 2021 08:01:56 using doxygen 1.8.15