summaryrefslogtreecommitdiff
path: root/src/keyboardconfig.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-10 21:12:29 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-10 21:12:29 +0300
commit3973b3175a1efdb0d47e93b93af6ae5f50cb62f8 (patch)
tree00e51ab584c108c6fd766a0f911a7c1e26ce8a1b /src/keyboardconfig.cpp
parent9df03a10b72b7e8c3b5bcf9cc7b595dc9fc17835 (diff)
downloadplus-3973b3175a1efdb0d47e93b93af6ae5f50cb62f8.tar.gz
plus-3973b3175a1efdb0d47e93b93af6ae5f50cb62f8.tar.bz2
plus-3973b3175a1efdb0d47e93b93af6ae5f50cb62f8.tar.xz
plus-3973b3175a1efdb0d47e93b93af6ae5f50cb62f8.zip
Move more code from keyboardconfig to inputmanager.
Diffstat (limited to 'src/keyboardconfig.cpp')
-rw-r--r--src/keyboardconfig.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp
index bcc10d553..7ebe7c9b3 100644
--- a/src/keyboardconfig.cpp
+++ b/src/keyboardconfig.cpp
@@ -63,20 +63,7 @@ int KeyboardConfig::getKeyValueFromEvent(const SDL_Event &event) const
int KeyboardConfig::getKeyIndex(const SDL_Event &event, int grp) const
{
const int keyValue = getKeyValueFromEvent(event);
- for (size_t i = 0; i < Input::KEY_TOTAL; i++)
- {
- KeyFunction &key = inputManager.getKey(i);
- for (size_t i2 = 0; i2 < KeyFunctionSize; i2 ++)
- {
- if (keyValue == key.values[i2].value
- && (grp & keyData[i].grp) != 0
- && key.values[i2].type == INPUT_KEYBOARD)
- {
- return i;
- }
- }
- }
- return Input::KEY_NO_VALUE;
+ return inputManager.getKeyIndex(keyValue, grp, INPUT_KEYBOARD);
}
void KeyboardConfig::refreshActiveKeys()