#include <ukeyevent.hpp>
Inheritance diagram for ufo::UKeyEvent:
Public Member Functions | |
UKeyEvent (UWidget *sourceA, Type typeA, UMod_t modifiersA, UKeyCode_t keyCodeA, uint16_t keyCharA=0) | |
UKeyCode_t | getKeyCode () |
uint16_t | getKeyChar () |
Static Public Attributes | |
const uint16_t | CHAR_UNDEFINED |
Protected Member Functions | |
virtual std::ostream & | paramString (std::ostream &os) const |
Protected Attributes | |
UKeyCode_t | m_keyCode |
uint16_t | m_keyChar |
A key event is used for indicating two types of events:
1. KeyPressed
/ KeyReleased Events: Generated whenever a key is pressed or release. Only with these events you can get information about keys which do not generate character output.
2. KeyTyped
Events: Generated whenever a Unicode character is entered. It can be represented by a single key press (e.g. 'u'), but most of the it represents multiple key presses (like shift + 'u' which results in a Unicode character 'U'). Some Keys canīt create Unicode character (like modifiers, action keys, ..) and donīt create KEY_TYPED events. The key code (returned by getKeyCode()) of KeyTyped
events return always VK_UNDEFINED. The getKeyChar() returns a valid Unicode character or CHAR_UNDEFINED.
Please note:The virtual key constants (UK_*) may change in future without any warning.
|
Returns the Unicode character for this key event. If this is a KEY_PRESSED or KEY_RELEASED key event, the value will be likely a CHAR_UNDEFINED ( at least for action keys, modifiers, ..) |
|
Returns the virtual key code for this key event. If this is a KEY_TYPED key event, this value will be always VK_UNDEFINED, else it should contain a valid key code. |
|
Prints some useful internal data to the ostream os. This method is meant only for debugging purposes. Reimplemented from ufo::UInputEvent.
|
|
KEY_PRESSED and KEY_RELEASED events which do not map to a valid Unicode character use this for the keyChar value. |