The event holds a pointer event data and typically originates from a mouse or other pointing device. More...
#include <kanzi/core.ui/platform/input/common/events.hpp>
Public Member Functions | |
PointerButton | getButtons () const |
Returns the buttons of the pointer event. More... | |
Vector2 | getPoint () const |
Returns a Vector2 representation of the touch point. More... | |
int | getScroll () const |
Returns the scroll distance of the pointer event. More... | |
PointerState | getState () const |
Returns the state of the pointer event. More... | |
int | getX () const |
Returns the x axis coordinate of the pointer event. More... | |
int | getY () const |
Returns the y axis coordinate of the pointer event. More... | |
bool | hasButton (PointerButton button) const |
Checks whether the given button is set on the pointer event. More... | |
bool | hasButtonWithState (PointerButton button, PointerState state) const |
Checks whether the given button is set for the given state. More... | |
PointerEvent (int x, int y, PointerButton buttons, PointerState state, int scroll=0) | |
Creates a PointerEvent for the (x, y) coordinates with the buttons, scroll, and state. More... | |
UniqueEventPtr | transform (const Matrix3x3 &transformationMatrix) const |
Transforms the pointer event using the given transformationMatrix. More... | |
Public Member Functions inherited from kanzi::InputEvent | |
Type | getType () const |
Returns the type of the event. More... | |
InputEvent (Type type) | |
Constructs an event with a given type. More... | |
bool | isHandled () const |
Returns true if the event is handled, false if not. More... | |
void | markHandled () |
Marks the event as handled. More... | |
virtual | ~InputEvent () |
Destructor. More... | |
Protected Attributes | |
PointerButton | m_buttons |
The buttons of the pointer event. More... | |
int | m_scroll |
The scroll amount of the pointer event. More... | |
PointerState | m_state |
The state of the pointer event. More... | |
int | m_x |
The x axis coordinate of the pointer event. More... | |
int | m_y |
The y axis coordinate of the pointer event. More... | |
Additional Inherited Members | |
Public Types inherited from kanzi::InputEvent | |
enum | Type { Key, Pointer, Touch, WindowResized, WindowResizeRequest, WindowFocusLost, WindowFocusGained, WindowHidden, WindowResourcesLost, WindowOrientationChanged, WindowRedrawRequest, WindowClosed, ApplicationPaused, ApplicationSleep, ApplicationWakeup, DebugToggleHud, DebugSetHud, UserEvent } |
InputEvent type enumeration. More... | |
The event holds a pointer event data and typically originates from a mouse or other pointing device.
It holds the coordinates of the event as well as the buttons pressed, the wheel scrolling distance, and the state.
The type of the event is InputEvent::Pointer.
|
explicit |
Creates a PointerEvent for the (x, y) coordinates with the buttons, scroll, and state.
x | The x axis coordinate of the pointer event. |
y | The y axis coordinate of the pointer event. |
buttons | The buttons set for the pointer event. See PointerButton. |
state | The state of the event. |
scroll | The amount scrolled. Does not depend on the state of the event. |
|
inline |
Returns the x axis coordinate of the pointer event.
|
inline |
Returns the y axis coordinate of the pointer event.
|
inline |
Returns the buttons of the pointer event.
|
inline |
Returns the scroll distance of the pointer event.
|
inline |
Returns the state of the pointer event.
UniqueEventPtr kanzi::PointerEvent::transform | ( | const Matrix3x3 & | transformationMatrix | ) | const |
Transforms the pointer event using the given transformationMatrix.
transformationMatrix | The transformation matrix to apply to the pointer. |
|
inline |
Checks whether the given button is set on the pointer event.
button | The pointer button to check. |
|
inline |
Checks whether the given button is set for the given state.
button | The pointer button to check. |
state | The state of the pointer. |
|
inline |
|
protected |
The x axis coordinate of the pointer event.
|
protected |
The y axis coordinate of the pointer event.
|
protected |
The scroll amount of the pointer event.
|
protected |
The buttons of the pointer event.
|
protected |
The state of the pointer event.