libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AlgAudio::KeyData Struct Reference

#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
 

Detailed Description

A custom structure representing keypress info. All functions that serve as reactions for keypresses work using KeyData.

Member Enumeration Documentation

Enumerator
Unknown 
Text 
Letter 
Digit 
Symbol 
Backspace 
Delete 
Return 
Shift 
Ctrl 
Alt 
Escape 

Constructor & Destructor Documentation

AlgAudio::KeyData::KeyData ( const SDL_KeyboardEvent &  )
AlgAudio::KeyData::KeyData ( std::string  )

This constructor creates a Text key data (See SDL's TextInput)

Member Function Documentation

static void AlgAudio::KeyData::InitKeymap ( )
static

Called by SDLMain::Init(). Builds a keycode lookup map so that SDL_KEYCODEs can be quickly translated to KeyData.

bool AlgAudio::KeyData::IsPrintable ( ) const
inline

Returns true if this key is a printable character or text.

bool AlgAudio::KeyData::IsTrig ( ) const
inline

Returns true if this is a non-repeated key-press.

Member Data Documentation

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.

KeyType AlgAudio::KeyData::type

The type of key this KeyData concerns.


The documentation for this struct was generated from the following file: