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. | |
Vector2 | getPoint () const |
Returns a Vector2 representation of the touch point. | |
int | getScroll () const |
Returns the scroll distance of the pointer event. | |
PointerState | getState () const |
Returns the state of the pointer event. | |
int | getX () const |
Returns the x axis coordinate of the pointer event. | |
int | getY () const |
Returns the y axis coordinate of the pointer event. | |
bool | hasButton (PointerButton button) const |
Checks whether the given button is set on the pointer event. | |
bool | hasButtonWithState (PointerButton button, PointerState state) const |
Checks whether the given button is set for the given state. | |
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. | |
UniqueEventPtr | transform (const Matrix3x3 &transformationMatrix) const |
Transforms the pointer event using the given transformationMatrix. | |
Public Member Functions inherited from kanzi::InputEvent | |
Type | getType () const |
Returns the type of the event. | |
InputEvent (Type type) | |
Constructs an event with a given type. | |
bool | isHandled () const |
Returns true if the event is handled, false if not. | |
void | markHandled () |
Marks the event as handled. | |
virtual | ~InputEvent () |
Destructor. | |
Protected Attributes | |
PointerButton | m_buttons |
The buttons of the pointer event. | |
int | m_scroll |
The scroll amount of the pointer event. | |
PointerState | m_state |
The state of the pointer event. | |
int | m_x |
The x axis coordinate of the pointer event. | |
int | m_y |
The y axis coordinate of the pointer event. | |
Additional Inherited Members | |
Public Types inherited from kanzi::InputEvent | |
enum | Type { Key , Pointer , Touch , WindowResized , WindowResizeRequest , WindowFocusLost , WindowFocusGained , WindowHidden , WindowResourcesLost , WindowOrientationChanged , WindowRedrawRequest , WindowPlacement , 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.