diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-28 21:37:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-28 21:37:19 +0300 |
commit | 03bfe2db420e0b219451590e14bb34c03c71f03c (patch) | |
tree | c3cb081449261b51f1ffefa2da4ba39fa5645888 /src/keyboardconfig.cpp | |
parent | c47ef8b3f2ec6ea0e26748af17cb12b7f9cd20c9 (diff) | |
download | manaverse-03bfe2db420e0b219451590e14bb34c03c71f03c.tar.gz manaverse-03bfe2db420e0b219451590e14bb34c03c71f03c.tar.bz2 manaverse-03bfe2db420e0b219451590e14bb34c03c71f03c.tar.xz manaverse-03bfe2db420e0b219451590e14bb34c03c71f03c.zip |
improve some other files.
Diffstat (limited to 'src/keyboardconfig.cpp')
-rw-r--r-- | src/keyboardconfig.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp index 33c1e3237..1bdc8f7ff 100644 --- a/src/keyboardconfig.cpp +++ b/src/keyboardconfig.cpp @@ -75,7 +75,7 @@ void KeyboardConfig::refreshActiveKeys() mActiveKeys = SDL_GetKeyState(nullptr); } -std::string KeyboardConfig::getKeyName(const int key) const +std::string KeyboardConfig::getKeyName(const int key) { if (key == Input::KEY_NO_VALUE) return ""; @@ -85,7 +85,7 @@ std::string KeyboardConfig::getKeyName(const int key) const return strprintf(_("key_%d"), key); } -std::string KeyboardConfig::getKeyShortString(const std::string &key) const +std::string KeyboardConfig::getKeyShortString(const std::string &key) { if (key == "backspace") { @@ -99,7 +99,7 @@ std::string KeyboardConfig::getKeyShortString(const std::string &key) const return key; } -SDLKey KeyboardConfig::getKeyFromEvent(const SDL_Event &event) const +SDLKey KeyboardConfig::getKeyFromEvent(const SDL_Event &event) { return event.key.keysym.sym; } @@ -138,10 +138,11 @@ bool KeyboardConfig::isActionActive(const int index) const const KeyFunction &key = inputManager.getKey(index); for (size_t i = 0; i < KeyFunctionSize; i ++) { - if (key.values[i].type != INPUT_KEYBOARD) + const KeyItem &val = key.values[i]; + if (val.type != INPUT_KEYBOARD) continue; - const int value = key.values[i].value; + const int value = val.value; if (value >= 0) { if (mActiveKeys[value]) |