diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-23 13:30:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-23 13:30:13 +0300 |
commit | be66e6d5b5043383cff10f51bd5a9daa4b9fc113 (patch) | |
tree | 22578a6c97fedbc8126cc7fd2fbd0686be361c64 /src | |
parent | 50bd5d794518e37b6d6f03134aba7fa88c687af2 (diff) | |
download | mv-be66e6d5b5043383cff10f51bd5a9daa4b9fc113.tar.gz mv-be66e6d5b5043383cff10f51bd5a9daa4b9fc113.tar.bz2 mv-be66e6d5b5043383cff10f51bd5a9daa4b9fc113.tar.xz mv-be66e6d5b5043383cff10f51bd5a9daa4b9fc113.zip |
Show long key names in browser box.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 2 | ||||
-rw-r--r-- | src/input/inputmanager.cpp | 10 | ||||
-rw-r--r-- | src/input/inputmanager.h | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 92892d6f4..6c44ae0d9 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -223,7 +223,7 @@ void BrowserBox::addRow(const std::string &row, const bool atTop) if (idx2 == std::string::npos) break; - const std::string str = inputManager.getKeyValueByName( + const std::string str = inputManager.getKeyValueByNameLong( tmp.substr(idx1 + 3, idx2 - idx1 - 3)); tmp.replace(idx1, idx2 - idx1 + 1, str); diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index 0d1d0bdbe..ecf2aac3e 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -447,6 +447,16 @@ std::string InputManager::getKeyValueByName(const std::string &keyName) return getKeyValueString((*it).second); } +std::string InputManager::getKeyValueByNameLong(const std::string &keyName) +{ + const std::map<std::string, int>::const_iterator + it = mNameMap.find(keyName); + + if (it == mNameMap.end()) + return std::string(); + return getKeyStringLong((*it).second); +} + void InputManager::addActionKey(const int action, const int type, const int val) { diff --git a/src/input/inputmanager.h b/src/input/inputmanager.h index b91af8882..5f4b7ad6b 100644 --- a/src/input/inputmanager.h +++ b/src/input/inputmanager.h @@ -70,6 +70,8 @@ class InputManager final std::string getKeyValueByName(const std::string &keyName); + std::string getKeyValueByNameLong(const std::string &keyName); + void addActionKey(const int action, const int type, const int val); void setNewKey(const SDL_Event &event, const int type); |