Ultralight C++ API 1.4.0
|
#include <Ultralight/KeyEvent.h>
Keyboard event representing a change in keyboard state.
Public Types | |
enum | Type { kType_KeyDown , kType_KeyUp , kType_RawKeyDown , kType_Char } |
The various KeyEvent types. More... | |
enum | Modifiers : uint8_t { kMod_AltKey = 1 << 0 , kMod_CtrlKey = 1 << 1 , kMod_MetaKey = 1 << 2 , kMod_ShiftKey = 1 << 3 } |
An enumeration of the different keyboard modifiers. More... | |
Public Member Functions | |
KeyEvent () | |
Creates an empty KeyEvent, you will need to initialize its members yourself. | |
Public Attributes | |
Type | type |
The type of this KeyEvent. | |
unsigned | modifiers |
The current state of the keyboard. | |
int | virtual_key_code |
The virtual key-code associated with this keyboard event. | |
int | native_key_code |
The actual key-code generated by the platform. | |
String | key_identifier |
This is a string identifying the key that was pressed. | |
String | text |
The actual text generated by this keyboard event. | |
String | unmodified_text |
The text generated by this keyboard event before all modifiers except shift are applied. | |
bool | is_keypad |
Whether or not this is a keypad event. | |
bool | is_auto_repeat |
Whether or not this was generated as the result of an auto-repeat (eg, holding down a key). | |
bool | is_system_key |
Whether or not the pressed key is a "system key". | |
enum Modifiers : uint8_t |
enum Type |
The various KeyEvent types.
KeyEvent | ( | ) |
Creates an empty KeyEvent, you will need to initialize its members yourself.
This is useful for synthesizing your own keyboard events.
bool is_auto_repeat |
Whether or not this was generated as the result of an auto-repeat (eg, holding down a key).
bool is_keypad |
Whether or not this is a keypad event.
bool is_system_key |
Whether or not the pressed key is a "system key".
This is a Windows-only concept and should be "false" for all non-Windows platforms. For more information, see the following link: http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx
String key_identifier |
This is a string identifying the key that was pressed.
This can be generated from the virtual_key_code via the GetKeyIdentifierFromVirtualKeyCode() utility function. You can find the full list of key identifiers at: https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/keyset.html
unsigned modifiers |
The current state of the keyboard.
Modifiers may be OR'd together to represent multiple values.
int native_key_code |
The actual key-code generated by the platform.
The DOM spec primarily uses Windows-equivalent codes (hence virtualKeyCode above) but it helps to also specify the platform-specific key-code as well.
String text |
The actual text generated by this keyboard event.
This is usually only a single character.
String unmodified_text |
The text generated by this keyboard event before all modifiers except shift are applied.
This is used internally for working out shortcut keys. This is usually only a single character.
int virtual_key_code |
The virtual key-code associated with this keyboard event.
This is either directly from the event (ie, WPARAM on Windows) or via a mapping function. You can see a full list of the possible virtual key-codes in KeyCodes.h