summaryrefslogtreecommitdiff
path: root/src/joystick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/joystick.cpp')
-rw-r--r--src/joystick.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/joystick.cpp b/src/joystick.cpp
index 1e5d5e5f9..0c78621d3 100644
--- a/src/joystick.cpp
+++ b/src/joystick.cpp
@@ -345,10 +345,14 @@ void Joystick::handleRepeat(const int time)
if (mActiveButtons[key])
repeat = true;
}
- if (repeat && abs(keyTime - time) > 10)
+ if (repeat)
{
- keyTime = time;
- inputManager.triggerAction(getActionVectorByKey(key));
+ if (time > keyTime && abs(time - keyTime)
+ > SDL_DEFAULT_REPEAT_DELAY * 10)
+ {
+ keyTime = time;
+ inputManager.triggerAction(getActionVectorByKey(key));
+ }
}
}
}