FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::Key Class Reference

Represents a key. More...

#include <key.h>

+ Collaboration diagram for FIFE::Key:

Public Types

Public Member Functions

 Key (KeyType key=INVALID_KEY)
 Constructor. More...
 
virtual ~Key ()
 Destructor. More...
 
bool isPrintable () const
 Tells whether the Key can be represented as a string. More...
 
bool isFunctionKey () const
 
KeyType getValue () const
 Gets the value of the key. More...
 
std::string getAsString () const
 Gets the string representation of the key, encoded as UTF-8. More...
 

Private Attributes

KeyType m_key
 

Detailed Description

Represents a key.

Definition at line 41 of file key.h.

Member Enumeration Documentation

Codes for different keys.

Enumerator
INVALID_KEY 
ENTER 
ESCAPE 
BACKSPACE 
TAB 
SPACE 
EXCLAIM 
QUOTEDBL 
HASH 
PERCENT 
DOLLAR 
AMPERSAND 
QUOTE 
LEFTPAREN 
RIGHTPAREN 
ASTERISK 
PLUS 
COMMA 
MINUS 
PERIOD 
SLASH 
NUM_0 
NUM_1 
NUM_2 
NUM_3 
NUM_4 
NUM_5 
NUM_6 
NUM_7 
NUM_8 
NUM_9 
COLON 
SEMICOLON 
LESS 
EQUALS 
GREATER 
QUESTION 
AT 
LEFTBRACKET 
BACKSLASH 
RIGHTBRACKET 
CARET 
UNDERSCORE 
BACKQUOTE 
CAPS_LOCK 
F1 
F2 
F3 
F4 
F5 
F6 
F7 
F8 
F9 
F10 
F11 
F12 
PRINT_SCREEN 
SCROLL_LOCK 
PAUSE 
INSERT 
HOME 
PAGE_UP 
DELETE 
END 
PAGE_DOWN 
RIGHT 
LEFT 
DOWN 
UP 
NUM_LOCK 
KP_DIVIDE 
KP_MULTIPLY 
KP_MINUS 
KP_PLUS 
KP_ENTER 
KP_0 
KP_1 
KP_2 
KP_3 
KP_4 
KP_5 
KP_6 
KP_7 
KP_8 
KP_9 
KP_PERIOD 
APPLICATION 
POWER 
KP_EQUALS 
F13 
F14 
F15 
F16 
F17 
F18 
F19 
F20 
F21 
F22 
F23 
F24 
EXECUTE 
HELP 
MENU 
SELECT 
STOP 
AGAIN 
UNDO 
CUT 
COPY 
PASTE 
FIND 
MUTE 
VOLUME_UP 
VOLUME_DOWN 
KP_COMMA 
KP_EQUALSAS400 
ERASE 
SYS_REQ 
CANCEL 
CLEAR 
PRIOR 
RETURN 
SEPARATOR 
FORTH 
OPER 
CLEAR_AGAIN 
CR_SEL 
EX_SEL 
KP_00 
KP_000 
THOUSANDS_SEPARATOR 
DECIMAL_SEPARATOR 
CURRENCY_UNIT 
CURRENCY_SUBUNIT 
KP_LEFTPAREN 
KP_RIGHTPAREN 
KP_LEFTBRACE 
KP_RIGHTBRACE 
KP_TAB 
KP_BACKSPACE 
KP_A 
KP_B 
KP_C 
KP_D 
KP_E 
KP_F 
KP_XOR 
KP_POWER 
KP_PERCENT 
KP_LESS 
KP_GREATER 
KP_AMPERSAND 
KP_DBLAMPERSAND 
KP_VERTICALBAR 
KP_DBLVERTICALBAR 
KP_COLON 
KP_HASH 
KP_SPACE 
KP_AT 
KP_EXCLAM 
KP_MEMSTORE 
KP_MEMRECALL 
KP_MEMCLEAR 
KP_MEMADD 
KP_MEMSUBSTRACT 
KP_MEMMULTIPLY 
KP_MEMDIVIDE 
KP_PLUSMINUS 
KP_CLEAR 
KP_CLEARENTRY 
KP_BINARY 
KP_OCTAL 
KP_DECIMAL 
KP_HEXADECIMAL 
LEFT_CONTROL 
LEFT_SHIFT 
LEFT_ALT 
LEFT_SUPER 
RIGHT_CONTROL 
RIGHT_SHIFT 
RIGHT_ALT 
RIGHT_SUPER 
ALT_GR 
AUDIO_NEXT 
AUDIO_PREV 
AUDIO_STOP 
AUDIO_PLAY 
AUDIO_MUTE 
MEDIASELECT 
WWW 
MAIL 
CALCULATOR 
COMPUTER 
AC_SEARCH 
AC_HOME 
AC_BACK 
AC_FORWARD 
AC_STOP 
AC_REFRESH 
AC_BOOKMARKS 
BRIGHTNESS_DOWN 
BRIGHTNESS_UP 
DISPLAY_SWITCH 
ILLUM_TOGGLE 
ILLUM_DOWN 
ILLUM_UP 
EJECT 
SLEEP 

Definition at line 45 of file key.h.

Constructor & Destructor Documentation

FIFE::Key::Key ( KeyType  key = INVALID_KEY)
inline

Constructor.

Parameters
keyvalue of the key

Definition at line 297 of file key.h.

virtual FIFE::Key::~Key ( )
inlinevirtual

Destructor.

Definition at line 302 of file key.h.

Member Function Documentation

std::string FIFE::Key::getAsString ( ) const
inline

Gets the string representation of the key, encoded as UTF-8.

Definition at line 327 of file key.h.

References m_key.

Referenced by isPrintable().

+ Here is the caller graph for this function:

KeyType FIFE::Key::getValue ( ) const
inline

Gets the value of the key.

Definition at line 321 of file key.h.

References m_key.

Referenced by FIFE::EventManager::processKeyEvent().

+ Here is the caller graph for this function:

bool FIFE::Key::isFunctionKey ( ) const
inline

Definition at line 314 of file key.h.

References F1, F12, F13, F24, and m_key.

bool FIFE::Key::isPrintable ( ) const
inline

Tells whether the Key can be represented as a string.

Definition at line 306 of file key.h.

References getAsString().

Member Data Documentation

KeyType FIFE::Key::m_key
private

Definition at line 333 of file key.h.

Referenced by getAsString(), getValue(), and isFunctionKey().


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