blip
0.1
|
A keyboard input event. More...
#include <KeyEvent.hpp>
Public Member Functions | |
virtual | ~KeyEvent () |
Destructor. More... | |
Action | getAction () const |
Get the keypress action for this event. More... | |
const ccxx::Flags< int32_t > | getFlags () const |
Get the flags associated with this event. More... | |
KeyCode | getKeyCode () const |
Get the keycode for this event. More... | |
char | getCharacter () const |
Get the ASCII character represented by this event. More... | |
int32_t | getScanCode () const |
Get the scancode for this event. More... | |
int32_t | getMetaState () const |
Get the state of the modifier keys at the time of this event. More... | |
int | getRepeatCount () const |
Get the repeat count for this event. More... | |
time_ms_t | getDownTime () const |
Get the amount of time that the key was held down. More... | |
virtual time_ms_t | getEventTime () const |
Get the time at which this event occurred. More... | |
bool | isMetaKeyPressed () const |
Test if any modifier key was pressed at the time of this event. More... | |
bool | isAltPressed () const |
Test if either Alt key was pressed at the time of this event. More... | |
bool | isLeftAltPressed () const |
Test if the left Alt key was pressed at the time of this event. More... | |
bool | isRightAltPressed () const |
Test if the right Alt key was pressed at the time of this event. More... | |
bool | isCapsLockPressed () const |
Test if the Caps Lock key was pressed at the time of this event. More... | |
bool | isControlPressed () const |
Test if either Control key was pressed at the time of this event. More... | |
bool | isLeftControlPressed () const |
Test if the left Control key was pressed at the time of this event. More... | |
bool | isRightControlPressed () const |
Test if the right Control key was pressed at the time of this event. More... | |
bool | isFunctionPressed () const |
Test if the Function key was pressed at the time of this event. More... | |
bool | isNumLockPressed () const |
Test if the Num Lock key was pressed at the time of this event. More... | |
bool | isScrollLockPressed () const |
Test if the Scroll Lock key was pressed at the time of this event. More... | |
bool | isShiftPressed () const |
Test if either Shift key was pressed at the time of this event. More... | |
bool | isLeftShiftPressed () const |
Test if the left Shift key was pressed at the time of this event. More... | |
bool | isRightShiftPressed () const |
Test if the right Shift key was pressed at the time of this event. More... | |
bool | isSymPressed () const |
Test if the Sym key was pressed at the time of this event. More... | |
int32_t | getDeviceID () const |
Get the ID of the input device which is the source of this event. More... | |
virtual Source | getSource () const |
Get the source of this event. More... | |
Class | getClass () const |
Get the class of this event. More... | |
Type | getType () const |
Get the event type. More... | |
Static Public Attributes | |
static const uint32_t | ALT_MASK = 1 << 1 |
A mask for testing if either Alt key was pressed. More... | |
static const uint32_t | ALT_LEFT_MASK = 1 << 4 |
A mask for testing if the left Alt key was pressed. More... | |
static const uint32_t | ALT_RIGHT_MASK = 1 << 5 |
A mask for testing if the right Alt key was pressed. More... | |
static const uint32_t | ALT_ANY_MASK = KeyEvent::ALT_MASK | KeyEvent::ALT_LEFT_MASK | KeyEvent::ALT_RIGHT_MASK |
A mask for testing if any Alt key was pressed. More... | |
static const uint32_t | CAPS_LOCK_MASK = 1 << 20 |
A mask for testing if the Caps Lock key was pressed. More... | |
static const uint32_t | CTRL_MASK = 1 << 12 |
A mask for testing if either Control key was pressed. More... | |
static const uint32_t | CTRL_LEFT_MASK = 1 << 13 |
A mask for testing if the left Control key was pressed. More... | |
static const uint32_t | CTRL_RIGHT_MASK = 1 << 14 |
A mask for testing if the right Control key was pressed. More... | |
static const uint32_t | CTRL_ANY_MASK = KeyEvent::CTRL_MASK | KeyEvent::CTRL_LEFT_MASK | KeyEvent::CTRL_RIGHT_MASK |
A mask for testing if any Control key was pressed. More... | |
static const uint32_t | FUNCTION_MASK = 1 << 3 |
A mask for testing if the Function key was pressed. More... | |
static const uint32_t | META_MASK = 1 << 16 |
A mask for testing if either Meta key was pressed. More... | |
static const uint32_t | META_LEFT_MASK = 1 << 17 |
A mask for testing if the left Meta key was pressed. More... | |
static const uint32_t | META_RIGHT_MASK = 1 << 18 |
A mask for testing if the right Meta key was pressed. More... | |
static const uint32_t | META_ANY_MASK = KeyEvent::META_MASK | KeyEvent::META_LEFT_MASK | KeyEvent::META_RIGHT_MASK |
A mask for testing if any Meta key was pressed. More... | |
static const uint32_t | NUM_LOCK_MASK = 1 << 21 |
A mask for testing if the Num Lock key was pressed. More... | |
static const uint32_t | SCROLL_LOCK_MASK = 1 << 22 |
A mask for testing if the Scroll Lock key was pressed. More... | |
static const uint32_t | SHIFT_MASK = 1 << 0 |
A mask for testing if either Shift key was pressed. More... | |
static const uint32_t | SHIFT_LEFT_MASK = 1 << 6 |
A mask for testing if the left Shift key was pressed. More... | |
static const uint32_t | SHIFT_RIGHT_MASK = 1 << 7 |
A mask for testing if the right Shift key was pressed. More... | |
static const uint32_t | SHIFT_ANY_MASK |
A mask for testing if any Shift key was pressed. More... | |
static const uint32_t | SYM_MASK = 1 << 2 |
A mask for testing if the Sym key was pressed. More... | |
A keyboard input event.
enum Action |
|
inherited |
enum KeyCode |
Key codes.
|
inherited |
|
inherited |
|
virtual |
Destructor.
KeyEvent::Action getAction | ( | ) | const |
Get the keypress action for this event.
char getCharacter | ( | ) | const |
Get the ASCII character represented by this event.
Note that this method assumes a keyboard with a US-English layout.
|
inherited |
Get the class of this event.
|
inherited |
Get the ID of the input device which is the source of this event.
time_ms_t getDownTime | ( | ) | const |
Get the amount of time that the key was held down.
|
virtual |
Get the time at which this event occurred.
Implements InputEvent.
const Flags< int32_t > getFlags | ( | ) | const |
Get the flags associated with this event.
KeyEvent::KeyCode getKeyCode | ( | ) | const |
Get the keycode for this event.
int32_t getMetaState | ( | ) | const |
Get the state of the modifier keys at the time of this event.
Generally it is simpler to use the convenience methods like isMetaKeyPressed() and isAltPressed() to test individual modifier keys.
int getRepeatCount | ( | ) | const |
Get the repeat count for this event.
int32_t getScanCode | ( | ) | const |
Get the scancode for this event.
|
virtualinherited |
Get the source of this event.
|
inlineinherited |
Get the event type.
bool isAltPressed | ( | ) | const |
Test if either Alt key was pressed at the time of this event.
bool isCapsLockPressed | ( | ) | const |
Test if the Caps Lock key was pressed at the time of this event.
bool isControlPressed | ( | ) | const |
Test if either Control key was pressed at the time of this event.
bool isFunctionPressed | ( | ) | const |
Test if the Function key was pressed at the time of this event.
bool isLeftAltPressed | ( | ) | const |
Test if the left Alt key was pressed at the time of this event.
bool isLeftControlPressed | ( | ) | const |
Test if the left Control key was pressed at the time of this event.
bool isLeftShiftPressed | ( | ) | const |
Test if the left Shift key was pressed at the time of this event.
bool isMetaKeyPressed | ( | ) | const |
Test if any modifier key was pressed at the time of this event.
bool isNumLockPressed | ( | ) | const |
Test if the Num Lock key was pressed at the time of this event.
bool isRightAltPressed | ( | ) | const |
Test if the right Alt key was pressed at the time of this event.
bool isRightControlPressed | ( | ) | const |
Test if the right Control key was pressed at the time of this event.
bool isRightShiftPressed | ( | ) | const |
Test if the right Shift key was pressed at the time of this event.
bool isScrollLockPressed | ( | ) | const |
Test if the Scroll Lock key was pressed at the time of this event.
bool isShiftPressed | ( | ) | const |
Test if either Shift key was pressed at the time of this event.
bool isSymPressed | ( | ) | const |
Test if the Sym key was pressed at the time of this event.
|
static |
A mask for testing if any Alt key was pressed.
|
static |
A mask for testing if the left Alt key was pressed.
|
static |
A mask for testing if either Alt key was pressed.
|
static |
A mask for testing if the right Alt key was pressed.
|
static |
A mask for testing if the Caps Lock key was pressed.
|
static |
A mask for testing if any Control key was pressed.
|
static |
A mask for testing if the left Control key was pressed.
|
static |
A mask for testing if either Control key was pressed.
|
static |
A mask for testing if the right Control key was pressed.
|
static |
A mask for testing if the Function key was pressed.
|
static |
A mask for testing if any Meta key was pressed.
|
static |
A mask for testing if the left Meta key was pressed.
|
static |
A mask for testing if either Meta key was pressed.
|
static |
A mask for testing if the right Meta key was pressed.
|
static |
A mask for testing if the Num Lock key was pressed.
|
static |
A mask for testing if the Scroll Lock key was pressed.
|
static |
A mask for testing if any Shift key was pressed.
|
static |
A mask for testing if the left Shift key was pressed.
|
static |
A mask for testing if either Shift key was pressed.
|
static |
A mask for testing if the right Shift key was pressed.
|
static |
A mask for testing if the Sym key was pressed.