Kanzi Framework  3.9.0
Kanzi Engine API
kanzi::PointerEvent Class Reference

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>

Inheritance diagram for kanzi::PointerEvent:
[legend]

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PointerEvent()

kanzi::PointerEvent::PointerEvent ( int  x,
int  y,
PointerButton  buttons,
PointerState  state,
int  scroll = 0 
)
explicit

Creates a PointerEvent for the (x, y) coordinates with the buttons, scroll, and state.

Parameters
xThe x axis coordinate of the pointer event.
yThe y axis coordinate of the pointer event.
buttonsThe buttons set for the pointer event. See PointerButton.
stateThe state of the event.
scrollThe amount scrolled. Does not depend on the state of the event.
Since
Kanzi 3.8.0 the buttons argument is of type PointerButton.

Member Function Documentation

◆ getX()

int kanzi::PointerEvent::getX ( ) const
inline

Returns the x axis coordinate of the pointer event.

◆ getY()

int kanzi::PointerEvent::getY ( ) const
inline

Returns the y axis coordinate of the pointer event.

◆ getButtons()

PointerButton kanzi::PointerEvent::getButtons ( ) const
inline

Returns the buttons of the pointer event.

Returns
The buttons of the pointer event.
Since
Kanzi 3.8.0 return type is PointerButton.

◆ getScroll()

int kanzi::PointerEvent::getScroll ( ) const
inline

Returns the scroll distance of the pointer event.

Returns
The scroll distance, indicating the distance the wheel is rotated. Positive value indicates forward rotation. Negative value indicates backward rotation.

◆ getState()

PointerState kanzi::PointerEvent::getState ( ) const
inline

Returns the state of the pointer event.

◆ transform()

UniqueEventPtr kanzi::PointerEvent::transform ( const Matrix3x3 transformationMatrix) const

Transforms the pointer event using the given transformationMatrix.

Parameters
transformationMatrixThe transformation matrix to apply to the pointer.
Returns
The unique pointer to the transformed pointer event.

◆ hasButton()

bool kanzi::PointerEvent::hasButton ( PointerButton  button) const
inline

Checks whether the given button is set on the pointer event.

Parameters
buttonThe pointer button to check.
Returns
true if the button is set, false otherwise.

◆ hasButtonWithState()

bool kanzi::PointerEvent::hasButtonWithState ( PointerButton  button,
PointerState  state 
) const
inline

Checks whether the given button is set for the given state.

Parameters
buttonThe pointer button to check.
stateThe state of the pointer.
Returns
true if the button is set, false otherwise.

◆ getPoint()

Vector2 kanzi::PointerEvent::getPoint ( ) const
inline

Returns a Vector2 representation of the touch point.

Returns
The Vector2 with the touch point.
Since
Kanzi 3.9.0

Member Data Documentation

◆ m_x

int kanzi::PointerEvent::m_x
protected

The x axis coordinate of the pointer event.

◆ m_y

int kanzi::PointerEvent::m_y
protected

The y axis coordinate of the pointer event.

◆ m_scroll

int kanzi::PointerEvent::m_scroll
protected

The scroll amount of the pointer event.

◆ m_buttons

PointerButton kanzi::PointerEvent::m_buttons
protected

The buttons of the pointer event.

◆ m_state

PointerState kanzi::PointerEvent::m_state
protected

The state of the pointer event.


The documentation for this class was generated from the following file: