#include <key.hpp>
Definition at line 67 of file key.hpp.
Public Types | |
enum | { SPACE = ' ', TAB = '\t', ENTER = '\n', LEFT_ALT = 1000, RIGHT_ALT, LEFT_SHIFT, RIGHT_SHIFT, LEFT_CONTROL, RIGHT_CONTROL, LEFT_META, RIGHT_META, LEFT_SUPER, RIGHT_SUPER, INSERT, HOME, PAGE_UP, DELETE, END, PAGE_DOWN, ESCAPE, CAPS_LOCK, BACKSPACE, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, PRINT_SCREEN, SCROLL_LOCK, PAUSE, NUM_LOCK, ALT_GR, LEFT, RIGHT, UP, DOWN } |
An enum with key values. | |
Public Member Functions | |
Key () | |
Constructor. | |
Key (int value) | |
Constructor. | |
bool | isCharacter () const |
Checks whether a key is a character. | |
bool | isNumber () const |
Checks whether a key is a number. | |
bool | isLetter () const |
Checks whether a key is a letter. | |
bool | isShiftPressed () const |
Checks whether shift is pressed. | |
void | setShiftPressed (bool pressed) |
Sets the shift pressed flag. | |
bool | isControlPressed () const |
Checks whether control is pressed. | |
void | setControlPressed (bool pressed) |
Sets the control pressed flag. | |
bool | isAltPressed () const |
Checks whether alt is pressed. | |
void | setAltPressed (bool pressed) |
Sets the alt pressed flag. | |
bool | isMetaPressed () const |
Checks whether meta is pressed. | |
void | setMetaPressed (bool pressed) |
Sets the meta pressed flag. | |
bool | isNumericPad () const |
Checks whether the key was pressed at the numeric pad. | |
void | setNumericPad (bool numpad) |
Sets the numeric pad flag. | |
int | getValue () const |
Gets the value of the key. | |
void | setValue (int value) |
Sets the value of the key. | |
Protected Attributes | |
int | mValue |
bool | mShiftPressed |
bool | mControlPressed |
bool | mAltPressed |
bool | mMetaPressed |
bool | mNumericPad |
|
Constructor.
|
|
Gets the value of the key. If an ascii value exists it will be returned. Otherwise an enum value will be returned.
Definition at line 158 of file key.cpp. Referenced by gcn::Gui::logic(). |
|
Checks whether alt is pressed.
|
|
Checks whether a key is a character.
|
|
Checks whether control is pressed.
|
|
Checks whether a key is a letter.
|
|
Checks whether meta is pressed.
|
|
Checks whether a key is a number.
|
|
Checks whether the key was pressed at the numeric pad.
|
|
Checks whether shift is pressed.
Definition at line 103 of file key.cpp. Referenced by gcn::Gui::logic(). |
|
Sets the alt pressed flag.
Definition at line 128 of file key.cpp. Referenced by gcn::SDLInput::convertKeyCharacter(), and gcn::AllegroInput::convertToKey(). |
|
Sets the control pressed flag.
Definition at line 118 of file key.cpp. Referenced by gcn::SDLInput::convertKeyCharacter(), and gcn::AllegroInput::convertToKey(). |
|
Sets the meta pressed flag.
Definition at line 138 of file key.cpp. Referenced by gcn::SDLInput::convertKeyCharacter(), and gcn::AllegroInput::convertToKey(). |
|
Sets the numeric pad flag.
Definition at line 148 of file key.cpp. Referenced by gcn::SDLInput::convertKeyCharacter(), and gcn::AllegroInput::convertToKey(). |
|
Sets the shift pressed flag.
Definition at line 108 of file key.cpp. Referenced by gcn::SDLInput::convertKeyCharacter(), and gcn::AllegroInput::convertToKey(). |
|
Sets the value of the key. An ascii value or an enum value.
Definition at line 153 of file key.cpp. Referenced by gcn::SDLInput::convertKeyCharacter(). |