This is the event handler.
More...
#include <GUIEventHandler.h>
This is the event handler.
It handles keyboard and mouse events based on CGUIEvent in HandleEvent by calling the appropriate methods on GUI objects. It also manages the focus, keeps track of the currently highlighted and pressed objects and the current modal dialog.
To learn more about event handling, see Input event handling.
◆ AddModalDialogException()
Add a new exception for modal dialogs. this object can be used even when a modal dialog is shown use with caution!!
- Parameters
-
pkException | object for exception |
◆ CreateInstance()
static void CGUIEventHandler::CreateInstance |
( |
| ) |
|
|
static |
◆ DeleteInstance()
static void CGUIEventHandler::DeleteInstance |
( |
| ) |
|
|
static |
◆ ExecuteClickHandler()
eC_Bool CGUIEventHandler::ExecuteClickHandler |
( |
CGUIObject * |
pkObject | ) |
|
Executes a click on a given object, iterates through whole event hierarchy
- Parameters
-
pkObject | Object to be clicked |
- Returns
- true if executed
◆ FocusLost()
void CGUIEventHandler::FocusLost |
( |
| ) |
|
Informs the event handler that the focus is lost. This happens for instance automatically if the currently focused object changes to a state (such as grayed out, disabled or invisible) in which it must not remain focused.
◆ GetCurrentEvent()
const CGUIEvent * CGUIEventHandler::GetCurrentEvent |
( |
| ) |
const |
Returns a pointer to the event that is currently being handled.
Use this method in an event handling slot to examine the current event in greater detail, for instance for checking keyboard modifier keys.
This method returns NULL if the event handler is not currently handling an event. This means that user code can only expect to receive a valid pointer from this method in any of the event handling slots declared in CGUIBehaviour.
- Returns
- pointer to the event that is currently being handled.
◆ GetCurrentModalDialog()
Get the current modal dialog that is active.
- Returns
- current active modal dialog
◆ GetDisableEventHandling()
eC_Bool CGUIEventHandler::GetDisableEventHandling |
( |
| ) |
const |
Returns whether user input currently is ignored.
- Returns
- True if user input currently is ignored, otherwise False.
◆ GetDoubleClickTime()
eC_UInt CGUIEventHandler::GetDoubleClickTime |
( |
| ) |
const |
Returns the time in milliseconds during which a button has to be clicked twice to generate a double click event.
- Returns
- Time in milliseconds during which a double click event is generated.
◆ GetDraggedObject()
CGUIObject * CGUIEventHandler::GetDraggedObject |
( |
| ) |
const |
Return the object which is currently being dragged
- Returns
- currently dragged object, if any
◆ GetDragStart()
void CGUIEventHandler::GetDragStart |
( |
eC_Int & |
iDragStartX, |
|
|
eC_Int & |
iDragStartY |
|
) |
| |
Returns the start coordinates of an ongoing drag operation. The returned values are valid only if there currently is a drag operation in progress. Do not use them after the concluding DoDragEnd() event.
- Parameters
-
iDragStartX | X Position in screen coordinates where the drag sequence started |
iDragStartY | Y Position in screen coordinates where the drag sequence started |
◆ GetDragThreshold()
eC_Int CGUIEventHandler::GetDragThreshold |
( |
| ) |
const |
Returns the current drag threshold.
- Returns
- Threshold (in pixels) after which a drag event shall not be recognized as a "click" anymore.
◆ GetFocussedObject()
CGUIObject * CGUIEventHandler::GetFocussedObject |
( |
| ) |
const |
Get object that is currently focused.
- Returns
- Pointer to the currently focused object.
◆ GetFormerlyFocussedObject()
CGUIObject * CGUIEventHandler::GetFormerlyFocussedObject |
( |
| ) |
const |
Return the object which was formerly focused.
- Returns
- object which lost the focus
- Note
- This is only valid within GetFocus())
◆ GetFormerlyUnderMouseObject()
CGUIObject * CGUIEventHandler::GetFormerlyUnderMouseObject |
( |
| ) |
const |
Return the object which formerly was under the mouse pointer.
- Returns
- object formerly under mouse-pointer
- Note
- This is only valid within DoMouseEnter()
◆ GetHighlightedObject()
CGUIObject * CGUIEventHandler::GetHighlightedObject |
( |
| ) |
const |
Return the currently highlighted object (the one beneath the cursor)
- Returns
- currently highlighted object, if any
◆ GetIdleTime()
eC_UInt CGUIEventHandler::GetIdleTime |
( |
| ) |
|
Returns the maximum allowed idle time in milliseconds.
- Returns
- maximum allowed idle time in milliseconds
◆ GetLastButtonDownTime()
eC_UInt CGUIEventHandler::GetLastButtonDownTime |
( |
| ) |
|
Returns the timestamp of the last ButtonDown-Event.
- Returns
- Timestamp of the last ButtonDown-Event
◆ GetLastMousePos()
void CGUIEventHandler::GetLastMousePos |
( |
eC_UInt & |
uiMouseX, |
|
|
eC_UInt & |
uiMouseY |
|
) |
| const |
Returns the last known mouse position
- Parameters
-
uiMouseX | x-position |
uiMouseY | y-position |
◆ GetLongClickTime()
eC_UInt CGUIEventHandler::GetLongClickTime |
( |
| ) |
const |
Returns the time in milliseconds that a mouse button needs be held down until a long click event is generated.
- Returns
- Time in milliseconds during which a long click event is generated.
◆ GetObjectUnderMousePointer()
CGUIObject * CGUIEventHandler::GetObjectUnderMousePointer |
( |
| ) |
const |
Return the object which is currently under the mouse pointer.
- Returns
- object currently under mouse-pointer
◆ GetPressedObject()
CGUIObject * CGUIEventHandler::GetPressedObject |
( |
| ) |
const |
Return the object which is currently being pressed
- Returns
- currently pressed object, if any
◆ IsLeftMouseButtonPressed()
eC_Bool CGUIEventHandler::IsLeftMouseButtonPressed |
( |
| ) |
const |
|
inline |
check if the left mouse-button is currently pressed
- Returns
- true if pressed
◆ IsObjModalDialog()
Check whether the object is a modal dialog or not.
- Parameters
-
- Returns
- True if modal, False otherwise
◆ IsRightMouseButtonPressed()
eC_Bool CGUIEventHandler::IsRightMouseButtonPressed |
( |
| ) |
const |
|
inline |
check if the right mouse-button is currently pressed
- Returns
- ture if pressed
◆ IsWithinModalDialogIfAny()
eC_Bool CGUIEventHandler::IsWithinModalDialogIfAny |
( |
const CGUIObject * |
pObj | ) |
const |
Checks if the given object lies within the currently active modal dialog (if there is one).
- Parameters
-
pObj | Pointer to object which shall be checked |
- Returns
- True if there is no modal dialog or if the object lies within the modal dialog, False otherwise
◆ MouseWasUsed()
eC_Bool CGUIEventHandler::MouseWasUsed |
( |
| ) |
const |
Indicates whether the last received Event was generated by a pointing device
- Returns
- true if mouse was used
◆ ReleaseModalDialog()
Release the given modal dialog (and thus remove it from the stack of modal dialogs) If there were other previous dialogs on the modal dialog stack, the most recent one will now become the active modal dialog again. In this case the framework will attemp to focus a child object of this newly actived modal dialog.
- Parameters
-
pModalDialog | Pointer to the modal dialog object |
◆ RemoveModalDialogException()
Remove a previously added exception for modal dialogs
- Parameters
-
pkException | object to remove |
◆ SetDisableEventHandling()
void CGUIEventHandler::SetDisableEventHandling |
( |
eC_Bool |
bDisableEventHandling | ) |
|
Sets an attribute that controls whether user input ought to be ignored or not.
- Parameters
-
bDisableEventHandling | true: Disable user input. else: Enable it. |
◆ SetDoubleClickTime()
void CGUIEventHandler::SetDoubleClickTime |
( |
const eC_UInt |
uiDoubleClickTime | ) |
|
Sets the time in milliseconds during which a button has to be clicked twice to generate a double click event.
- Parameters
-
uiDoubleClickTime | Time in milliseconds in which a double click event is generated. |
◆ SetDragThreshold()
void CGUIEventHandler::SetDragThreshold |
( |
const eC_Int |
iDragThreshold | ) |
|
Set the threshold (in pixels) after which a drag event shall not be recognized as a "click" anymore. Especially for touch-screen devices, it is usually not desired that dragging an object also results in clicking it. This threshold defines the dragging distance after which releasing the finger will not call DoClick() anymore, but instead always result in a call to DoButtonUp().
- Parameters
-
iDragThreshold | Threshold (in pixels) after which a drag event shall not be recognized as a "click" anymore. |
- Deprecated:
- Function call will not work anymore, use SetLongClickThresholdX, SetLongClickThresholdY, SetClickToleranceX, SetClickToleranceY instead.
◆ SetHighlightingDisabled()
void CGUIEventHandler::SetHighlightingDisabled |
( |
const eC_Bool |
bDisabled | ) |
|
Disables highlighting of objects in reaction to "mouse-over" events. By default highlighting is enabled. It is advisable to disable highlighting on devices which do not require it.
- Parameters
-
bDisabled | True disables highlighting, False enables it. |
◆ SetLegacyBehaviour()
void CGUIEventHandler::SetLegacyBehaviour |
( |
const eC_Bool |
bLegacyBehaviour | ) |
|
Activate or De-Activate legacy behaviour to be backwards-compatible to older Guiliani-versions
- Parameters
-
bLegacyBehaviour | true if mode should be activated |
◆ SetLongClickTime()
void CGUIEventHandler::SetLongClickTime |
( |
const eC_UInt |
uiLongClickTime | ) |
|
Sets the time in milliseconds that a mouse button needs be held down until a long click event is generated.
- Parameters
-
uiLongClickTime | Time in milliseconds until a long click event is generated. |
◆ SetModalDialog()
Make a specific dialog the active modal dialog. This also sets the focus into the dialog if there is at least one focusable object in this dialog. Modal dialogs can be stacked, and if the modal dialog is already in the list of modal dialogs, it will become the active modal dialog.
- Parameters
-
pModalDialog | Pointer to the CompositeObject which will become the model dialog |
◆ SetMouseWasUsed()
void CGUIEventHandler::SetMouseWasUsed |
( |
eC_Bool |
bMouseUsed | ) |
|
Sets the MouseWasUsed flag
- Parameters
-
◆ SetScrollModifiers()
void CGUIEventHandler::SetScrollModifiers |
( |
eC_UInt |
uiScrollModifiers | ) |
|
Set the modifiers for mousewheel scrolling.
The default modifier is the SHIFT key.
- Parameters
-
uiScrollModifiers | The modifiers bitfield. |
- See also
- CGUIEvent::Modifier_t
◆ CGUI
◆ CGUIComponentManager
◆ CGUIObject
The documentation for this class was generated from the following file: