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-07-22 21:17:15 +0000
committerStijn Buys <ingar@osirion.org>2008-07-22 21:17:15 +0000
commit540b500f2176966ebfb7f21ebd2c17ddfdcd34e6 (patch)
treee31bbf0046237b5134002f51d48c1b3f5b752f4f /src/client/keyboard.cc
parent9adc3720cd8fe2ba843d014dbbfe81bf936f9715 (diff)
keyboard key repeat
Diffstat (limited to 'src/client/keyboard.cc')
-rw-r--r--src/client/keyboard.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/keyboard.cc b/src/client/keyboard.cc
index 410e76c..10d98ea 100644
--- a/src/client/keyboard.cc
+++ b/src/client/keyboard.cc
@@ -214,7 +214,7 @@ Keyboard::~Keyboard()
{
// clear key map
for (iterator it = begin(); it != end(); it++)
- delete(*it).second;
+ delete (*it).second;
keys.clear();
// clear action list
@@ -284,6 +284,7 @@ Key * Keyboard::release(unsigned int sym)
}
key->pressed() = 0;
+ key->lastpressed() = 0;
return key;
}
@@ -294,8 +295,14 @@ Key * Keyboard::press(unsigned int sym)
return 0;
}
+ return press(key);
+}
+
+Key * Keyboard::press(Key *key)
+{
if (!key->pressed())
key->pressed() = core::application()->time();
+ key->lastpressed() = core::application()->time();
return key;
}