From 3973b3175a1efdb0d47e93b93af6ae5f50cb62f8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Apr 2012 21:12:29 +0300 Subject: Move more code from keyboardconfig to inputmanager. --- src/keyboardconfig.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/keyboardconfig.cpp') 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() -- cgit v1.2.3-60-g2f50