_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <key.h>
Public Types | |
enum | { K_SPACE = ' ', K_TAB = '\t', K_ENTER = '\n', K_LEFT_ALT = 1000, K_RIGHT_ALT, K_LEFT_SHIFT, K_RIGHT_SHIFT, K_LEFT_CONTROL, K_RIGHT_CONTROL, K_LEFT_META, K_RIGHT_META, K_LEFT_SUPER, K_RIGHT_SUPER, K_INSERT, K_HOME, K_PAGE_UP, K_DELETE, K_END, K_PAGE_DOWN, K_ESCAPE, K_CAPS_LOCK, K_BACKSPACE, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_F13, K_F14, K_F15, K_PRINT_SCREEN, K_SCROLL_LOCK, K_PAUSE, K_NUM_LOCK, K_ALT_GR, K_LEFT, K_RIGHT, K_UP, K_DOWN } |
Public Member Functions | |
Key () | |
Key (int value) | |
bool | isCharacter () const |
bool | isNumber () const |
bool | isLetter () const |
bool | isShiftPressed () const |
void | setShiftPressed (bool pressed) |
bool | isControlPressed () const |
void | setControlPressed (bool pressed) |
bool | isAltPressed () const |
void | setAltPressed (bool pressed) |
bool | isMetaPressed () const |
void | setMetaPressed (bool pressed) |
bool | isNumericPad () const |
void | setNumericPad (bool numpad) |
int | getValue () const |
void | setValue (int value) |
std::string | toString () const |
Protected Attributes | |
int | mValue |
bool | mShiftPressed |
bool | mControlPressed |
bool | mAltPressed |
bool | mMetaPressed |
bool | mNumericPad |
Represents a key or a character.
anonymous enum |
An enum with key values.
gcn::Key::Key | ( | ) |
Constructor.
gcn::Key::Key | ( | int | value | ) |
Constructor.
value | the ascii or enum value for the key. |
int gcn::Key::getValue | ( | ) | const |
Gets the value of the key. If an ascii value exists it will be returned. Otherwise an enum value will be returned.
bool gcn::Key::isAltPressed | ( | ) | const |
Checks whether alt is pressed.
bool gcn::Key::isCharacter | ( | ) | const |
Checks whether a key is a character.
bool gcn::Key::isControlPressed | ( | ) | const |
Checks whether control is pressed.
bool gcn::Key::isLetter | ( | ) | const |
Checks whether a key is a letter.
bool gcn::Key::isMetaPressed | ( | ) | const |
Checks whether meta is pressed.
bool gcn::Key::isNumber | ( | ) | const |
Checks whether a key is a number.
bool gcn::Key::isNumericPad | ( | ) | const |
Checks whether the key was pressed at the numeric pad.
bool gcn::Key::isShiftPressed | ( | ) | const |
Checks whether shift is pressed.
void gcn::Key::setAltPressed | ( | bool | pressed | ) |
Sets the alt pressed flag.
pressed | the alt flag value. |
void gcn::Key::setControlPressed | ( | bool | pressed | ) |
Sets the control pressed flag.
pressed | the control flag value. |
void gcn::Key::setMetaPressed | ( | bool | pressed | ) |
Sets the meta pressed flag.
pressed | the meta flag value. |
void gcn::Key::setNumericPad | ( | bool | numpad | ) |
Sets the numeric pad flag.
numpad | the numeric pad flag value. |
void gcn::Key::setShiftPressed | ( | bool | pressed | ) |
Sets the shift pressed flag.
pressed | the shift flag value. |
void gcn::Key::setValue | ( | int | value | ) |
Sets the value of the key. An ascii value or an enum value.
value | the key value. |
std::string gcn::Key::toString | ( | ) | const |
Convert to a UTF8 string
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |