diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-11-14 16:55:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-11-14 18:37:50 +0300 |
commit | 13642a6cddd8657ec84a2bfa94c6ac7d34545dba (patch) | |
tree | cefec154fe5b6ec59990c4ef5cfe67eba4a484e6 /src/keyboardconfig.cpp | |
parent | eaaafe3312a361e332d495ee68451e424d90a19d (diff) | |
download | plus-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.tar.gz plus-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.tar.bz2 plus-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.tar.xz plus-13642a6cddd8657ec84a2bfa94c6ac7d34545dba.zip |
Add support for on screen joystick for moving.
Diffstat (limited to 'src/keyboardconfig.cpp')
-rw-r--r-- | src/keyboardconfig.cpp | 14 |
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(); |