summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorSteve Cotton <steve@s.cotton.clara.co.uk>2009-02-11 23:28:18 +0000
committerIra Rice <irarice@gmail.com>2009-02-13 08:04:10 -0700
commitcb0be69dcf9ca771943fbe36c8b740490a6f459c (patch)
tree1fdae03b92aabd7652a6257797ed6fcc4e42a05d /src/game.cpp
parent35d95932256d615da0599bad8acdbf91777962b0 (diff)
downloadmana-cb0be69dcf9ca771943fbe36c8b740490a6f459c.tar.gz
mana-cb0be69dcf9ca771943fbe36c8b740490a6f459c.tar.bz2
mana-cb0be69dcf9ca771943fbe36c8b740490a6f459c.tar.xz
mana-cb0be69dcf9ca771943fbe36c8b740490a6f459c.zip
Ignore "window manager + arrow" key combinations
Adds two configurable "ignore" keys. Stops the character moving about if the user's window manager uses "ignore+arrow key" to switch virtual desktops.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 03febaff..e4b6e54d 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -792,6 +792,15 @@ void Game::handleInput()
// Get the state of the keyboard keys
keyboard.refreshActiveKeys();
+ // Ignore input if either "ignore" key is pressed
+ // Stops the character moving about if the user's window manager
+ // uses "ignore+arrow key" to switch virtual desktops.
+ if (keyboard.isKeyActive(keyboard.KEY_IGNORE_INPUT_1) ||
+ keyboard.isKeyActive(keyboard.KEY_IGNORE_INPUT_2))
+ {
+ return;
+ }
+
const Uint16 x = player_node->mX;
const Uint16 y = player_node->mY;
unsigned char direction = 0;