Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-09-03 19:43:31 +0000
committerStijn Buys <ingar@osirion.org>2008-09-03 19:43:31 +0000
commit033bd59cfc2dff93529ad448459ad6348ea29c8d (patch)
treec7311c4473bce2ec4e391c41427157d42f12c433 /src/client/input.cc
parente56e8566789c5fcb5073bd5064c2edfa2b81f848 (diff)
only one key repeat per frame
Diffstat (limited to 'src/client/input.cc')
-rw-r--r--src/client/input.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/client/input.cc b/src/client/input.cc
index 75fa0f3..5cbb17c 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -786,11 +786,8 @@ void frame(float seconds)
for (Keyboard::iterator it = keyboard->begin(); it != keyboard->end(); it++) {
key = (*it).second;
if (key && key->pressed()) {
- while ((key->pressed()+delay < core::application()->time()) && (key->lastpressed()+repeat < core::application()->time())) {
- if (key->lastpressed() > key->pressed())
- key->key_lastpressed += repeat;
- else
- key->key_lastpressed += delay;
+ if ((key->pressed()+delay < core::application()->time()) && (key->lastpressed()+repeat < core::application()->time())) {
+ key->key_lastpressed = core::application()->time();
key_pressed(key);
}
}