KeyEvent Class Reference
Generic description of a keyboard event. More...
#include <gz/common/KeyEvent.hh>
Public Types | |
| enum | EventType { NO_EVENT , PRESS , RELEASE } |
| Key event types enumeration. More... | |
Public Member Functions | |
| KeyEvent () | |
| Constructor. More... | |
| KeyEvent (const KeyEvent &_other) | |
| Copy constructor. More... | |
| KeyEvent (KeyEvent &&_other) | |
| ~KeyEvent () | |
| Destructor. More... | |
| bool | Alt () const |
| Get whether the alt key was held during this key event. More... | |
| bool | Control () const |
| Get whether the control key was held during this key event. More... | |
| int | Key () const |
| Get the key number. More... | |
| KeyEvent & | operator= (const KeyEvent &_other) |
| Assignment operator. More... | |
| KeyEvent & | operator= (KeyEvent &&other) |
| Move assignment operator. More... | |
| void | SetAlt (bool _alt) |
| Set whether the alt key was held during this key event. More... | |
| void | SetControl (bool _control) |
| Set whether the control key was held during this key event. More... | |
| void | SetKey (int _key) |
| Set the key. More... | |
| void | SetShift (bool _shift) |
| Set whether the shift key was held during this key event. More... | |
| void | SetText (const std::string &_text) |
| Set the formatted string of the key pressed. More... | |
| void | SetType (EventType _type) |
| Set the event type. More... | |
| bool | Shift () const |
| Get whether the shift key was held during this key event. More... | |
| std::string | Text () const |
| Get the formatted string of the key pressed (could be uppercase). More... | |
| EventType | Type () const |
| Get the event type. More... | |
Detailed Description
Generic description of a keyboard event.
Member Enumeration Documentation
◆ EventType
| enum EventType |
Constructor & Destructor Documentation
◆ KeyEvent() [1/3]
| KeyEvent | ( | ) |
Constructor.
◆ KeyEvent() [2/3]
◆ KeyEvent() [3/3]
◆ ~KeyEvent()
| ~KeyEvent | ( | ) |
Destructor.
Member Function Documentation
◆ Alt()
| bool Alt | ( | ) | const |
Get whether the alt key was held during this key event.
- Returns
- True if the alt key was pressed
◆ Control()
| bool Control | ( | ) | const |
Get whether the control key was held during this key event.
- Returns
- True if the control key was pressed
◆ Key()
| int Key | ( | ) | const |
Get the key number.
- Returns
- The key number
◆ operator=() [1/2]
Assignment operator.
- Parameters
-
[in] _other Other key event
- Returns
- this
◆ operator=() [2/2]
Move assignment operator.
- Parameters
-
[in] _other Other key event
- Returns
- this
◆ SetAlt()
| void SetAlt | ( | bool | _alt | ) |
Set whether the alt key was held during this key event.
- Parameters
-
[in] _alt Status of the alt key
◆ SetControl()
| void SetControl | ( | bool | _control | ) |
Set whether the control key was held during this key event.
- Parameters
-
[in] _control Status of the control key
◆ SetKey()
| void SetKey | ( | int | _key | ) |
Set the key.
- Parameters
-
[in] _key The key number
◆ SetShift()
| void SetShift | ( | bool | _shift | ) |
Set whether the shift key was held during this key event.
- Parameters
-
[in] _shift Status of the shift key
◆ SetText()
| void SetText | ( | const std::string & | _text | ) |
Set the formatted string of the key pressed.
- Parameters
-
[in] _text Formatted string of the key pressed.
◆ SetType()
◆ Shift()
| bool Shift | ( | ) | const |
Get whether the shift key was held during this key event.
- Returns
- True if the shift key was pressed
◆ Text()
| std::string Text | ( | ) | const |
Get the formatted string of the key pressed (could be uppercase).
- Returns
- The formatted string of the key pressed.
◆ Type()
| EventType Type | ( | ) | const |
Get the event type.
- Returns
- The key event type
The documentation for this class was generated from the following file: