#include <Keyboard.h>
Public Member Functions | |
| bool | loadKeyFile (bool loadDefaults=false) |
| bool | saveKeyFile () |
| bool | init () |
| char * | getkeyboardbuffer (unsigned int &bufCnt) |
| unsigned int | getKeyboardState () |
| KeyboardHistory::HistoryElement * | getkeyboardhistory (unsigned int &histCnt) |
| void | processKeyboardEvent (SDL_Event &event) |
| KeyboardKey * | getKey (const char *name) |
| std::list < std::string > & | getKeyList () |
| std::list < KeyboardKey * > & | getCommandKeys () |
| std::map < std::string, KeyboardKey * > & | getKeyMap () |
Static Public Member Functions | |
| static Keyboard * | instance () |
| static bool & | getDvorak () |
Protected Member Functions | |
| void | clear () |
| bool | loadKeyFile (const std::string &fileName, bool masterFile) |
| void | handleUnicodeUTF16 (Uint16 utf16, SDLKey key) |
| void | raiseUnicodeUTF16 (Uint16 utf16, SDLKey key) |
Protected Attributes | |
| KeyboardHistory::HistoryElement | keybHist_ [MAX_KEYBDHIST] |
| int | keybHistCnt_ |
| Uint16 | mHighSurrogate |
| std::map < std::string, KeyboardKey * > | keyMap_ |
| std::list < KeyboardKey * > | commandKeys_ |
| std::list< std::string > | keyList_ |
Static Protected Attributes | |
| static Keyboard * | instance_ = 0 |
| static bool | dvorak_ = false |
Private Member Functions | |
| Keyboard () | |
| virtual | ~Keyboard () |
Definition at line 33 of file Keyboard.h.
| Keyboard::Keyboard | ( | ) | [private] |
Definition at line 39 of file Keyboard.cpp.
| Keyboard::~Keyboard | ( | ) | [private, virtual] |
Definition at line 44 of file Keyboard.cpp.
| Keyboard * Keyboard::instance | ( | ) | [static] |
Definition at line 29 of file Keyboard.cpp.
References instance_.
Referenced by ClientWindowSetup::addStateWindows(), ClientMain::clientEventLoop(), createKeysControls(), GLWChannelText::initFromXML(), GLWChannelView::initFromXMLInternal(), initHardware(), ConsoleImpl::keyboardCheck(), GLWTracker::mouseDrag(), GLWDragger::mouseDrag(), DisplayFrame::onKeyButton(), DisplayFrame::onLoadDefaultKeysButton(), DisplayFrame::refreshKeysControls(), GameState::simulate(), MainCamera::simulate(), and DisplayFrame::TransferDataFromWindow().
| bool Keyboard::loadKeyFile | ( | bool | loadDefaults = false |
) |
Definition at line 213 of file Keyboard.cpp.
References clear(), commandKeys_, S3D::dialogMessage(), S3D::fileExists(), S3D::formatStringBuffer(), S3D::getDataFile(), KeyboardKey::getKeys(), KeyboardKey::getName(), KeyboardKey::getNameIsCommand(), S3D::getSettingsFile(), KeyboardKey::KeyEntry::key, KeyboardKey::keyIndex(), keyMap_, KeyboardKey::removeKey(), KeyboardKey::KeyEntry::state, KeyboardKey::translateKeyNameValue(), and KeyboardKey::translateKeyStateValue().
Referenced by DisplayFrame::onLoadDefaultKeysButton().
| bool Keyboard::saveKeyFile | ( | ) |
Definition at line 168 of file Keyboard.cpp.
References XMLNode::addChild(), XMLNode::addParameter(), S3D::formatStringBuffer(), KeyboardKey::getChanged(), KeyboardKey::getDescription(), KeyboardKey::getGroup(), getKey(), KeyboardKey::getKeys(), KeyboardKey::getName(), KeyboardKey::getNameIsCommand(), S3D::getSettingsFile(), KeyboardKey::getTitle(), KeyboardKey::KeyEntry::key, keyList_, KeyboardKey::KeyEntry::state, LangStringUtil::strcmp(), KeyboardKey::translateKeyNameValue(), KeyboardKey::translateKeyStateValue(), XMLNode::writeToFile(), and XMLNode::XMLParameterType.
Referenced by DisplayFrame::TransferDataFromWindow().
| bool Keyboard::init | ( | ) |
Definition at line 49 of file Keyboard.cpp.
| char * Keyboard::getkeyboardbuffer | ( | unsigned int & | bufCnt | ) |
| unsigned int Keyboard::getKeyboardState | ( | ) |
Definition at line 56 of file Keyboard.cpp.
Referenced by GLWTracker::mouseDrag(), GLWDragger::mouseDrag(), and GameState::simulate().
| KeyboardHistory::HistoryElement * Keyboard::getkeyboardhistory | ( | unsigned int & | histCnt | ) |
Definition at line 71 of file Keyboard.cpp.
References keybHist_, and keybHistCnt_.
Referenced by GameState::simulate().
| void Keyboard::processKeyboardEvent | ( | SDL_Event & | event | ) |
Definition at line 141 of file Keyboard.cpp.
References handleUnicodeUTF16().
Referenced by ClientMain::clientEventLoop().
| bool & Keyboard::getDvorak | ( | ) | [static] |
| KeyboardKey * Keyboard::getKey | ( | const char * | name | ) |
Definition at line 413 of file Keyboard.cpp.
References S3D::dialogMessage(), S3D::formatStringBuffer(), and keyMap_.
Referenced by ClientWindowSetup::addStateWindows(), createKeysControls(), GLWChannelText::initFromXML(), GLWChannelView::initFromXMLInternal(), DisplayFrame::onKeyButton(), DisplayFrame::refreshKeysControls(), and saveKeyFile().
| std::list<std::string>& Keyboard::getKeyList | ( | ) | [inline] |
| std::list<KeyboardKey *>& Keyboard::getCommandKeys | ( | ) | [inline] |
Definition at line 51 of file Keyboard.h.
References commandKeys_.
Referenced by ConsoleImpl::keyboardCheck().
| std::map<std::string, KeyboardKey *>& Keyboard::getKeyMap | ( | ) | [inline] |
| void Keyboard::clear | ( | ) | [protected] |
Definition at line 154 of file Keyboard.cpp.
References commandKeys_, keyList_, and keyMap_.
Referenced by loadKeyFile().
| bool Keyboard::loadKeyFile | ( | const std::string & | fileName, | |
| bool | masterFile | |||
| ) | [protected] |
Definition at line 275 of file Keyboard.cpp.
References KeyboardKey::addKeys(), S3D::dialogMessage(), XMLNode::failChildren(), file, S3D::formatStringBuffer(), XMLNode::getChildren(), XMLNode::getContent(), XMLNode::getName(), XMLNode::getNamedChild(), XMLNode::getNamedParameter(), XMLFile::getParserError(), XMLFile::getRootNode(), keyList_, keyMap_, XMLFile::readFile(), KeyboardKey::setChanged(), and LangStringUtil::strcmp().
| void Keyboard::handleUnicodeUTF16 | ( | Uint16 | utf16, | |
| SDLKey | key | |||
| ) | [protected] |
Definition at line 98 of file Keyboard.cpp.
References mHighSurrogate, raiseUnicodeUTF16(), UTF16_IS_HIGH_SURROGATE, UTF16_IS_LOW_SURROGATE, and UTF16_SURROGATE_PAIR_TO_UTF32.
Referenced by processKeyboardEvent().
| void Keyboard::raiseUnicodeUTF16 | ( | Uint16 | utf16, | |
| SDLKey | key | |||
| ) | [protected] |
Definition at line 83 of file Keyboard.cpp.
References keybHist_, keybHistCnt_, and MAX_KEYBDHIST.
Referenced by handleUnicodeUTF16().
Keyboard * Keyboard::instance_ = 0 [static, protected] |
bool Keyboard::dvorak_ = false [static, protected] |
KeyboardHistory::HistoryElement Keyboard::keybHist_[MAX_KEYBDHIST] [protected] |
Definition at line 57 of file Keyboard.h.
Referenced by getkeyboardhistory(), and raiseUnicodeUTF16().
int Keyboard::keybHistCnt_ [protected] |
Definition at line 58 of file Keyboard.h.
Referenced by getkeyboardhistory(), and raiseUnicodeUTF16().
Uint16 Keyboard::mHighSurrogate [protected] |
std::map<std::string, KeyboardKey *> Keyboard::keyMap_ [protected] |
Definition at line 66 of file Keyboard.h.
Referenced by clear(), getKey(), getKeyMap(), and loadKeyFile().
std::list<KeyboardKey *> Keyboard::commandKeys_ [protected] |
Definition at line 67 of file Keyboard.h.
Referenced by clear(), getCommandKeys(), and loadKeyFile().
std::list<std::string> Keyboard::keyList_ [protected] |
Definition at line 68 of file Keyboard.h.
Referenced by clear(), getKeyList(), loadKeyFile(), and saveKeyFile().
1.5.3