Sleeping Wombat GUI
0.100
swGUI
|
Keyboard state and events. More...
#include <KeyboardDevice.h>
Public Member Functions | |
KeyboardDevice ()=default | |
~KeyboardDevice ()=default | |
const InputDeviceInfo & | GetInfo () const |
const KeyboardState & | GetState () const |
EventQueue< DeviceEvent > & | GetEventsQueue () |
void | ApplyAllEvents () |
DeviceEvent | ApplyNextEvent () |
Timestamp | GetNextEvtTimestamp () |
void | RemoveEvents () |
Functions for setting state (only for IInput) | |
void | AddEvent (const DeviceEvent &event) |
Add event to event queue. This function doesn't change KeyboardState. More... | |
Public Member Functions inherited from sw::input::Device | |
Device ()=default | |
virtual | ~Device ()=default |
Private Attributes | |
InputDeviceInfo | m_info |
KeyboardState | m_state |
EventQueue< DeviceEvent > | m_events |
Keyboard state and events.
There are 2 types of events for keyboard.
Although character events depend on physical input, there's no one to one relationship between them. Operating system processes characters in different manner. For example when you hold keyboard button with letter, it will be repeated multiple times, despite of the fact that it was clicked only once. Another examples are keys that give special meaning to buttons like shift or alt.
When you apply events to current KeyboardState only KeyEvents are processed and CharacterEvents are ignored. m_characters vector is usefull in case of GUI systems and text fields, where you don't want to translate keyboard state to letters by yourself.
|
explicitdefault |
|
default |
|
inline |
Add event to event queue. This function doesn't change KeyboardState.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |