NDEVR
API Documentation
MouseEvent

Describes a mouse or touch input event with position, button, and modifier information. More...

Inheritance diagram for MouseEvent:
[legend]
Collaboration diagram for MouseEvent:
[legend]

Public Types

enum  MouseClickType { e_right_button , e_center_button , e_left_button , none }
 Identifies which mouse button was involved in the event. More...
enum  MouseEventType {
  e_mouse_clicked , e_mouse_dragged , e_mouse_entered , e_mouse_exited ,
  e_mouse_moved , e_mouse_pressed , e_mouse_released , e_mouse_scrolled ,
  e_touch_zoomed
}
 The type of mouse or touch action that occurred. More...

Public Member Functions

 MouseEvent ()
 Constructs a default MouseEvent with no associated window instance.
 MouseEvent (WindowInstance *instance)
 Constructs a MouseEvent associated with the given window instance.
bool hasModifier (KeyEvent::KeyModifier modifier) const
 Checks whether a specific key modifier was active during this mouse event.
bool operator== (const MouseEvent &other) const
 Checks equality between two MouseEvent objects.

Public Attributes

MouseClickType click_type = MouseClickType::none
 Which mouse button was involved.
Vector< 2, fltp04distance_scrolled = Constant<Vector<2, fltp04>>::Invalid
 The scroll distance in X and Y directions.
Vector< 2, fltp04event_location = Constant<Vector<2, fltp04>>::Invalid
 The current mouse position in window coordinates.
MouseEventType event_type = MouseEventType::e_mouse_exited
 The type of mouse action that occurred.
uint01 key_modifier = 0
 Bitmask of active KeyModifier flags during this event.
uint01 number_of_clicks = 0
 The number of consecutive clicks (e.g., 2 for double-click).
Vector< 2, fltp04prev_location = Constant<Vector<2, fltp04>>::Invalid
 The previous mouse position in window coordinates.
WindowInstancewindow_instance
 The window instance where this event originated.

Detailed Description

Describes a mouse or touch input event with position, button, and modifier information.


Definition at line 315 of file Event.h.

Member Enumeration Documentation

◆ MouseClickType

Identifies which mouse button was involved in the event.

Enumerator
e_right_button 

The right mouse button.

e_center_button 

The center (middle) mouse button.

e_left_button 

The left mouse button.

none 

No mouse button involved.

Definition at line 337 of file Event.h.

◆ MouseEventType

The type of mouse or touch action that occurred.

Enumerator
e_mouse_clicked 

A complete click (press and release) occurred.

e_mouse_dragged 

The mouse moved while a button was held down.

e_mouse_entered 

The mouse cursor entered the window or widget area.

e_mouse_exited 

The mouse cursor exited the window or widget area.

e_mouse_moved 

The mouse moved without any button pressed.

e_mouse_pressed 

A mouse button was pressed down.

e_mouse_released 

A mouse button was released.

e_mouse_scrolled 

The mouse scroll wheel was used.

e_touch_zoomed 

A pinch-to-zoom touch gesture was performed.

Definition at line 321 of file Event.h.

Constructor & Destructor Documentation

◆ MouseEvent()

MouseEvent::MouseEvent ( WindowInstance * instance)
inline

Constructs a MouseEvent associated with the given window instance.

Parameters
[in]instanceThe window instance where the mouse event originated.

Definition at line 355 of file Event.h.

References window_instance.

Member Function Documentation

◆ hasModifier()

bool MouseEvent::hasModifier ( KeyEvent::KeyModifier modifier) const
inline

Checks whether a specific key modifier was active during this mouse event.

Parameters
[in]modifierThe KeyModifier flag to test for.
Returns
True if the specified modifier is present in key_modifier.

Definition at line 363 of file Event.h.

References cast(), and key_modifier.

◆ operator==()

bool MouseEvent::operator== ( const MouseEvent & other) const
inline

Checks equality between two MouseEvent objects.

Parameters
[in]otherThe MouseEvent to compare against.
Returns
True if all event properties match.

Definition at line 381 of file Event.h.

References MouseEvent(), click_type, distance_scrolled, event_location, event_type, key_modifier, number_of_clicks, prev_location, and window_instance.


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