|
CeresEngine 0.2.0
A game development framework
|
#include <CeresEngine/UI/UIEvent.hpp>
Public Attributes | |
| UIPoint | locationInWindow |
| The receiver's location in the base coordinate system of the associated window. | |
| UInt32 | buttonNumber = 0 |
| The button number for a mouse event. | |
| UInt32 | clickCount = 0 |
| The number of mouse clicks associated with a mouse-down or mouse-up event. | |
| UIPoint | delta |
| The mouse coordinate change for mouse-move, mouse-drag, and swipe events. | |
Public Attributes inherited from CeresEngine::UIEvent | |
| UIEventType | type |
| The event's type. | |
| double | timestamp = 0.0 |
| The time when the event occurred in seconds since system startup. | |
| UIWindow * | window = nullptr |
| The window object associated with the event. | |
| UIModifierKeys | modifiers = {} |
| An integer bit field indicating the event's modifier keys. | |
| UInt32 CeresEngine::UIMouseEvent::buttonNumber = 0 |
The button number for a mouse event.
This property is intended for use with the otherMouseDown, otherMouseUp, and otherMouseDragged events, but will return values for leftMouse... and rightMouse... events also.
| UInt32 CeresEngine::UIMouseEvent::clickCount = 0 |
The number of mouse clicks associated with a mouse-down or mouse-up event.
This property is set to 0 for a mouse-up event if a time threshold has passed since the corresponding mouse-down event. This is because if this time threshold passes before the mouse button is released, it is no longer considered a mouse click, but a mouse-down event followed by a mouse-up event.
The return value of this method is meaningless for events other than mouse-down or mouse-up events.
| UIPoint CeresEngine::UIMouseEvent::delta |
The mouse coordinate change for mouse-move, mouse-drag, and swipe events.
This property is only valid for scroll wheel, mouse-move, and mouse-drag events.
| UIPoint CeresEngine::UIMouseEvent::locationInWindow |
The receiver's location in the base coordinate system of the associated window.
With mouseMoved and possibly other events, the event can have a nullptr window (that is, the window property contains nullptr). In this case, locationInWindow returns the event location in screen coordinates.
In a method of a custom view that handles mouse events, you commonly use the locationInWindow property in conjunction with the UIView method convert() to get the mouse location in the view's coordinate system.