libAlgAudio
v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
|
#include <Utilities.hpp>
Public Types | |
enum | KeyType { Unknown, Text, Letter, Digit, Symbol, Backspace, Delete, Return, Shift, Ctrl, Alt, Escape } |
Public Member Functions | |
bool | IsPrintable () const |
bool | IsTrig () const |
KeyData (const SDL_KeyboardEvent &) | |
KeyData (std::string) | |
Static Public Member Functions | |
static void | InitKeymap () |
Public Attributes | |
bool | alt = false |
bool | ctrl = false |
bool | pressed = true |
bool | repeat = false |
bool | shift = false |
std::string | symbol = "" |
KeyType | type |
A custom structure representing keypress info. All functions that serve as reactions for keypresses work using KeyData.
AlgAudio::KeyData::KeyData | ( | const SDL_KeyboardEvent & | ) |
AlgAudio::KeyData::KeyData | ( | std::string | ) |
This constructor creates a Text key data (See SDL's TextInput)
|
static |
Called by SDLMain::Init(). Builds a keycode lookup map so that SDL_KEYCODEs can be quickly translated to KeyData.
|
inline |
Returns true if this key is a printable character or text.
|
inline |
Returns true if this is a non-repeated key-press.
bool AlgAudio::KeyData::alt = false |
bool AlgAudio::KeyData::ctrl = false |
bool AlgAudio::KeyData::pressed = true |
Marks whether this key event is about pressing or releasin a key
bool AlgAudio::KeyData::repeat = false |
True, if this event is a system repetition of a held-down key
bool AlgAudio::KeyData::shift = false |
Modifiers state at the time of the event.
std::string AlgAudio::KeyData::symbol = "" |
The human-readable name or symbol of this key.