diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-19 23:48:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-19 23:48:29 +0300 |
commit | 0b7e752bd177c90a05ca752fa31810f9e34c432c (patch) | |
tree | db1809a48faf051af11c94058e8f126c9e9ef1ab /src/inputmanager.cpp | |
parent | 23f87c10db7e6b149e9e1f351e1a82516c545df7 (diff) | |
download | plus-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.gz plus-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.bz2 plus-0b7e752bd177c90a05ca752fa31810f9e34c432c.tar.xz plus-0b7e752bd177c90a05ca752fa31810f9e34c432c.zip |
Dehardcode keys in gui widgets.
Add new tab with keys settings in input settings tab.
Diffstat (limited to 'src/inputmanager.cpp')
-rw-r--r-- | src/inputmanager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/inputmanager.cpp b/src/inputmanager.cpp index fcb40d4ea..4617bed19 100644 --- a/src/inputmanager.cpp +++ b/src/inputmanager.cpp @@ -546,7 +546,7 @@ void InputManager::updateConditionMask() if (!setupWindow || !setupWindow->isVisible()) mMask += COND_NOSETUP; - if (Game::instance()->getValidSpeed()) + if (Game::instance() && Game::instance()->getValidSpeed()) mMask += COND_VALIDSPEED; if (gui && !gui->getFocusHandler()->getModalFocused()) @@ -607,7 +607,7 @@ void InputManager::updateKeyActionMap(KeyToActionMap &actionMap, actionMap[ki.value].push_back(i); } } - if (keyData[i].configField && (keyData[i].grp & Input::GRP_GUI)) + if (keyData[i].configField && (keyData[i].grp & Input::GRP_GUICHAN)) { for (size_t i2 = 0; i2 < KeyFunctionSize; i2 ++) { @@ -671,7 +671,7 @@ int InputManager::getKeyIndex(int value, int grp, int type) const int InputManager::getActionByKey(const SDL_Event &event) { // for now support only keyboard events - if (event.type == SDL_KEYDOWN) + if (event.type == SDL_KEYDOWN || event.type == SDL_KEYUP) { int idx = keyboard.getActionId(event); if (idx >= 0 && checkKey(&keyData[idx])) |