diff options
Diffstat (limited to 'src/inputmanager.cpp')
-rw-r--r-- | src/inputmanager.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/inputmanager.cpp b/src/inputmanager.cpp index 9cf456143..0bbbeda10 100644 --- a/src/inputmanager.cpp +++ b/src/inputmanager.cpp @@ -594,12 +594,24 @@ bool InputManager::invokeKey(const KeyData *const key, const int keyNum) if (checkKey(key)) { InputEvent evt(keyNum, mMask); - if ((*(keyData[keyNum].action))(evt)) + ActionFuncPtr func = *(keyData[keyNum].action); + if (func && func(evt)) return true; } return false; } +void InputManager::executeAction(const int keyNum) +{ + if (keyNum < 0 || keyNum >= Input::KEY_TOTAL) + return; + + InputEvent evt(keyNum, mMask); + ActionFuncPtr func = *(keyData[keyNum].action); + if (func) + func(evt); +} + void InputManager::updateKeyActionMap(KeyToActionMap &actionMap, KeyToIdMap &idMap, KeyTimeMap &keyTimeMap, |