summaryrefslogtreecommitdiff
path: root/src/keyboardconfig.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-11-14 16:55:35 +0300
committerAndrei Karas <akaras@inbox.ru>2012-11-14 18:37:50 +0300
commit13642a6cddd8657ec84a2bfa94c6ac7d34545dba (patch)
treecefec154fe5b6ec59990c4ef5cfe67eba4a484e6 /src/keyboardconfig.cpp
parenteaaafe3312a361e332d495ee68451e424d90a19d (diff)
downloadmv-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.tar.gz
mv-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.tar.bz2
mv-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.tar.xz
mv-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.zip
Add support for on screen joystick for moving.
Diffstat (limited to 'src/keyboardconfig.cpp')
-rw-r--r--src/keyboardconfig.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp
index 043024796..1ee73471a 100644
--- a/src/keyboardconfig.cpp
+++ b/src/keyboardconfig.cpp
@@ -170,6 +170,13 @@ void KeyboardConfig::handleActicateKey(const SDL_Event &event)
resetRepeat(key);
}
+void KeyboardConfig::handleActicateKey(const int key)
+{
+ if (key < -1 && key > -500)
+ mActiveKeys2[-key] = 1;
+ resetRepeat(key);
+}
+
void KeyboardConfig::handleDeActicateKey(const SDL_Event &event)
{
const int key = getKeyValueFromEvent(event);
@@ -178,6 +185,13 @@ void KeyboardConfig::handleDeActicateKey(const SDL_Event &event)
resetRepeat(key);
}
+void KeyboardConfig::handleDeActicateKey(const int key)
+{
+ if (key < -1 && key > -500)
+ mActiveKeys2[-key] = 0;
+ resetRepeat(key);
+}
+
void KeyboardConfig::handleRepeat(const int time)
{
for (KeyTimeMapIter it = mKeyTimeMap.begin(), it_end = mKeyTimeMap.end();