summaryrefslogtreecommitdiff
path: root/src/inputmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inputmanager.cpp')
-rw-r--r--src/inputmanager.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/inputmanager.cpp b/src/inputmanager.cpp
index cc45a79cf..22af8438c 100644
--- a/src/inputmanager.cpp
+++ b/src/inputmanager.cpp
@@ -361,18 +361,25 @@ void InputManager::unassignKey()
keyboard.update();
}
+bool InputManager::handleAssignKey(const SDL_Event &event)
+{
+ if (setupWindow && setupWindow->isVisible() &&
+ getNewKeyIndex() > Input::KEY_NO_VALUE)
+ {
+ setNewKey(event);
+ callbackNewKey();
+ setNewKeyIndex(Input::KEY_NO_VALUE);
+ return true;
+ }
+ return false;
+}
+
bool InputManager::handleEvent(const SDL_Event &event)
{
if (event.type == SDL_KEYDOWN)
{
- if (setupWindow && setupWindow->isVisible() &&
- getNewKeyIndex() > Input::KEY_NO_VALUE)
- {
- setNewKey(event);
- callbackNewKey();
- setNewKeyIndex(Input::KEY_NO_VALUE);
+ if (handleAssignKey(event))
return true;
- }
// send straight to gui for certain windows
if (quitDialog || TextDialog::isActive() ||