summaryrefslogtreecommitdiff
path: root/src/inputmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inputmanager.cpp')
-rw-r--r--src/inputmanager.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/inputmanager.cpp b/src/inputmanager.cpp
index 3a4ee1b9b..9f07d1fe9 100644
--- a/src/inputmanager.cpp
+++ b/src/inputmanager.cpp
@@ -526,6 +526,14 @@ bool InputManager::handleEvent(const SDL_Event &event)
return false;
}
+void InputManager::handleRepeat()
+{
+ const int time = tick_time;
+ keyboard.handleRepeat(time);
+ if (joystick)
+ joystick->handleRepeat(time);
+}
+
void InputManager::updateConditionMask()
{
mMask = 1;
@@ -590,9 +598,12 @@ bool InputManager::invokeKey(const KeyData *key, int keyNum)
}
void InputManager::updateKeyActionMap(KeyToActionMap &actionMap,
- KeyToIdMap &idMap, int type)
+ KeyToIdMap &idMap,
+ KeyTimeMap &keyTimeMap,
+ int type)
{
actionMap.clear();
+ keyTimeMap.clear();
for (size_t i = 0; i < Input::KEY_TOTAL; i ++)
{
@@ -615,6 +626,15 @@ void InputManager::updateKeyActionMap(KeyToActionMap &actionMap,
idMap[ki.value] = i;
}
}
+ if (keyData[i].configField && (keyData[i].grp & Input::GRP_REPEAT))
+ {
+ for (size_t i2 = 0; i2 < KeyFunctionSize; i2 ++)
+ {
+ const KeyItem &ki = key.values[i2];
+ if (ki.type == type && ki.value != -1)
+ keyTimeMap[ki.value] = 0;
+ }
+ }
}
keySorter.keys = &keyData[0];