From cb0be69dcf9ca771943fbe36c8b740490a6f459c Mon Sep 17 00:00:00 2001 From: Steve Cotton Date: Wed, 11 Feb 2009 23:28:18 +0000 Subject: 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. --- src/game.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/game.cpp') 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; -- cgit v1.2.3-70-g09d2