summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 5b701fc1..68380f5b 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -527,11 +527,11 @@ void Game::handleInput()
done = true;
// Close the Browser if opened
else if (helpWindow->isVisible() &&
- keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT))
+ keyboard.isKeyActive(keyboard.KEY_OK))
helpWindow->setVisible(false);
// Close the config window, cancelling changes if opened
else if (setupWindow->isVisible() &&
- keyboard.isKeyActive(keyboard.KEY_TOGGLE_CHAT))
+ keyboard.isKeyActive(keyboard.KEY_OK))
setupWindow->action(gcn::ActionEvent(NULL, "cancel"));
// Submits the text and proceeds to the next dialog
else if (npcStringDialog->isVisible() &&
@@ -553,7 +553,9 @@ void Game::handleInput()
KeyboardConfig::KEY_TOGGLE_CHAT) ==
keyboard.getKeyValue(
KeyboardConfig::KEY_OK) &&
- (npcStringDialog->isVisible() ||
+ (helpWindow->isVisible() ||
+ setupWindow->isVisible() ||
+ npcStringDialog->isVisible() ||
npcTextDialog->isVisible() ||
npcListDialog->isVisible() ||
npcIntegerDialog->isVisible())))
@@ -794,6 +796,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;