#include <KeyboardKey.h>
Public Member Functions | |
| KeyboardKey (const char *name, const char *title, const char *description, int group, bool command) | |
| virtual | ~KeyboardKey () |
| bool | keyDown (char *buffer, unsigned int keyState, bool repeat=true) |
| bool | keyMatch (unsigned key) |
| bool | addKeys (std::list< std::string > &keyNames, std::list< std::string > &keyStates) |
| void | addKey (unsigned int position, unsigned int key, unsigned int state) |
| void | removeKey (unsigned int position) |
| int | keyIndex (unsigned int key, unsigned int state) |
| std::vector< KeyEntry > & | getKeys () |
| const char * | getName () |
| const char * | getTitle () |
| const char * | getDescription () |
| int | getGroup () |
| bool | getNameIsCommand () |
| bool | getChanged () |
| void | setChanged (bool changed) |
Static Public Member Functions | |
| static bool | translateKeyName (const char *name, unsigned int &key) |
| static bool | translateKeyState (const char *name, unsigned int &state) |
| static bool | translateKeyNameValue (unsigned int key, const char *&name) |
| static bool | translateKeyStateValue (unsigned int state, const char *&name) |
Protected Attributes | |
| std::string | name_ |
| std::string | title_ |
| std::string | description_ |
| std::vector< KeyEntry > | keys_ |
| int | group_ |
| bool | keyToogle_ |
| bool | command_ |
| bool | changed_ |
Private Member Functions | |
| KeyboardKey (const KeyboardKey &) | |
| const KeyboardKey & | operator= (const KeyboardKey &) |
Classes | |
| struct | KeyEntry |
Definition at line 28 of file KeyboardKey.h.
| KeyboardKey::KeyboardKey | ( | const char * | name, | |
| const char * | title, | |||
| const char * | description, | |||
| int | group, | |||
| bool | command | |||
| ) |
Definition at line 26 of file KeyboardKey.cpp.
| KeyboardKey::~KeyboardKey | ( | ) | [virtual] |
Definition at line 37 of file KeyboardKey.cpp.
| KeyboardKey::KeyboardKey | ( | const KeyboardKey & | ) | [private] |
| bool KeyboardKey::keyDown | ( | char * | buffer, | |
| unsigned int | keyState, | |||
| bool | repeat = true | |||
| ) |
Definition at line 184 of file KeyboardKey.cpp.
References keys_, and keyToogle_.
Referenced by GLWWindowManager::keyboardCheck(), ConsoleImpl::keyboardCheck(), GLWChannelView::keyDown(), and TankKeyboardControlUtil::moveUpDown().
| bool KeyboardKey::keyMatch | ( | unsigned | key | ) |
| bool KeyboardKey::addKeys | ( | std::list< std::string > & | keyNames, | |
| std::list< std::string > & | keyStates | |||
| ) |
Definition at line 41 of file KeyboardKey.cpp.
References addKey(), DIALOG_ASSERT, S3D::dialogMessage(), S3D::formatStringBuffer(), keys_, name_, translateKeyName(), and translateKeyState().
Referenced by Keyboard::loadKeyFile().
| void KeyboardKey::addKey | ( | unsigned int | position, | |
| unsigned int | key, | |||
| unsigned int | state | |||
| ) |
Definition at line 96 of file KeyboardKey.cpp.
References changed_, KeyboardKey::KeyEntry::key, keys_, and KeyboardKey::KeyEntry::state.
Referenced by addKeys(), and DisplayFrame::onKeyButton().
| void KeyboardKey::removeKey | ( | unsigned int | position | ) |
Definition at line 114 of file KeyboardKey.cpp.
References changed_, and keys_.
Referenced by Keyboard::loadKeyFile(), and DisplayFrame::onKeyButton().
| int KeyboardKey::keyIndex | ( | unsigned int | key, | |
| unsigned int | state | |||
| ) |
Definition at line 81 of file KeyboardKey.cpp.
References KeyboardKey::KeyEntry::key, keys_, and KeyboardKey::KeyEntry::state.
Referenced by Keyboard::loadKeyFile().
| std::vector<KeyEntry>& KeyboardKey::getKeys | ( | ) | [inline] |
Definition at line 54 of file KeyboardKey.h.
References keys_.
Referenced by Keyboard::loadKeyFile(), DisplayFrame::onKeyButton(), GLWChannelText::processNotVisibleKey(), DisplayFrame::refreshKeysControls(), and Keyboard::saveKeyFile().
| const char* KeyboardKey::getName | ( | ) | [inline] |
Definition at line 55 of file KeyboardKey.h.
References name_.
Referenced by createKeysControls(), ConsoleImpl::keyboardCheck(), Keyboard::loadKeyFile(), and Keyboard::saveKeyFile().
| const char* KeyboardKey::getTitle | ( | ) | [inline] |
Definition at line 56 of file KeyboardKey.h.
References title_.
Referenced by createKeysControls(), and Keyboard::saveKeyFile().
| const char* KeyboardKey::getDescription | ( | ) | [inline] |
Definition at line 57 of file KeyboardKey.h.
References description_.
Referenced by createKeysControls(), and Keyboard::saveKeyFile().
| int KeyboardKey::getGroup | ( | ) | [inline] |
Definition at line 58 of file KeyboardKey.h.
References group_.
Referenced by createKeysControls(), and Keyboard::saveKeyFile().
| bool KeyboardKey::getNameIsCommand | ( | ) | [inline] |
Definition at line 59 of file KeyboardKey.h.
References command_.
Referenced by Keyboard::loadKeyFile(), and Keyboard::saveKeyFile().
| bool KeyboardKey::getChanged | ( | ) | [inline] |
Definition at line 60 of file KeyboardKey.h.
References changed_.
Referenced by Keyboard::saveKeyFile().
| void KeyboardKey::setChanged | ( | bool | changed | ) | [inline] |
Definition at line 61 of file KeyboardKey.h.
References changed_.
Referenced by Keyboard::loadKeyFile().
| bool KeyboardKey::translateKeyName | ( | const char * | name, | |
| unsigned int & | key | |||
| ) | [static] |
Definition at line 134 of file KeyboardKey.cpp.
References KeyTranslation::keySym, KeyTranslationTable, and LangStringUtil::strcmp().
Referenced by addKeys().
| bool KeyboardKey::translateKeyState | ( | const char * | name, | |
| unsigned int & | state | |||
| ) | [static] |
Definition at line 147 of file KeyboardKey.cpp.
References KeyStateTranslation::keyStateSym, KeyStateTranslationTable, and LangStringUtil::strcmp().
Referenced by addKeys().
| bool KeyboardKey::translateKeyNameValue | ( | unsigned int | key, | |
| const char *& | name | |||
| ) | [static] |
Definition at line 160 of file KeyboardKey.cpp.
References KeyTranslation::keyName, and KeyTranslationTable.
Referenced by Keyboard::loadKeyFile(), DisplayFrame::refreshKeysControls(), and Keyboard::saveKeyFile().
| bool KeyboardKey::translateKeyStateValue | ( | unsigned int | state, | |
| const char *& | name | |||
| ) | [static] |
Definition at line 172 of file KeyboardKey.cpp.
References KeyStateTranslation::keyStateName, and KeyStateTranslationTable.
Referenced by Keyboard::loadKeyFile(), DisplayFrame::refreshKeysControls(), and Keyboard::saveKeyFile().
| const KeyboardKey& KeyboardKey::operator= | ( | const KeyboardKey & | ) | [private] |
std::string KeyboardKey::name_ [protected] |
std::string KeyboardKey::title_ [protected] |
std::string KeyboardKey::description_ [protected] |
std::vector<KeyEntry> KeyboardKey::keys_ [protected] |
Definition at line 72 of file KeyboardKey.h.
Referenced by addKey(), addKeys(), getKeys(), keyDown(), keyIndex(), keyMatch(), and removeKey().
int KeyboardKey::group_ [protected] |
bool KeyboardKey::keyToogle_ [protected] |
bool KeyboardKey::command_ [protected] |
bool KeyboardKey::changed_ [protected] |
Definition at line 76 of file KeyboardKey.h.
Referenced by addKey(), getChanged(), removeKey(), and setChanged().
1.5.3