NDEVR
API Documentation

Describes a user key press event used to trigger behavior in the NDEVR API. More...

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

Public Types

enum  KEY
enum  KeyEentType { e_key_unspecified , e_key_pressed , e_key_released }
 The action taken with the key The type of the KeyEvent determines how the program will react. More...
enum  KeyModifier {
  e_shift = 0x01 , e_ctrl = 0x02 , e_function = 0x04 , e_alt = 0x08 ,
  e_meta = 0x10
}
 Modifiers describe a second key which affects the behavior of the key being pressed. More...

Public Member Functions

 KeyEvent ()
 Constructs a default KeyEvent with no key, modifier, or type set.
 KeyEvent (KEY key_type, uint01 key_modifier=0, KeyEentType event_type=KeyEentType::e_key_unspecified)
 Constructs a KeyEvent with the specified key, modifier, and event type.
bool operator== (const KeyEvent &other) const
 Checks equality between two KeyEvent objects.
char toChar () const
 Converts this key event to its corresponding ASCII character.

Public Attributes

KeyEentType event_type
 The type of key action (pressed, released, or unspecified).
uint01 key_modifier
 Bitmask of active KeyModifier flags during this event.
KEY key_type
 The virtual key code associated with this event.

Detailed Description

Describes a user key press event used to trigger behavior in the NDEVR API.


Definition at line 48 of file Event.h.

Member Enumeration Documentation

◆ KEY


The pressed key

Definition at line 54 of file Event.h.

◆ KeyEentType

The action taken with the key The type of the KeyEvent determines how the program will react.


Enumerator
e_key_unspecified 

Unspecified key action.

e_key_pressed 

Key is pushed to the 'down' position.

e_key_released 

After key pressed, key returns to default 'up' position.

Definition at line 251 of file Event.h.

◆ KeyModifier

Modifiers describe a second key which affects the behavior of the key being pressed.


Enumerator
e_shift 

The Shift key modifier.

e_ctrl 

The Control key modifier.

e_function 

The Function key modifier.

e_alt 

The Alt key modifier.

e_meta 

The Meta (Windows/Command) key modifier.

Definition at line 262 of file Event.h.

Constructor & Destructor Documentation

◆ KeyEvent()

KeyEvent::KeyEvent ( KEY key_type,
uint01 key_modifier = 0,
KeyEentType event_type = KeyEentType::e_key_unspecified )
inline

Constructs a KeyEvent with the specified key, modifier, and event type.

Parameters
[in]key_typeThe virtual key code that was pressed or released.
[in]key_modifierBitmask of KeyModifier values active during the event.
[in]event_typeWhether the key was pressed, released, or unspecified.

Definition at line 285 of file Event.h.

References e_key_unspecified, event_type, key_modifier, and key_type.

Member Function Documentation

◆ operator==()

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

Checks equality between two KeyEvent objects.

Parameters
[in]otherThe KeyEvent to compare against.
Returns
True if key_type, event_type, and key_modifier all match.

Definition at line 298 of file Event.h.

References KeyEvent(), event_type, key_modifier, and key_type.

◆ toChar()

char KeyEvent::toChar ( ) const

Converts this key event to its corresponding ASCII character.

Returns
The character representation of the key, or a null character if not representable.

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