summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game.cpp9
-rw-r--r--src/keyboardconfig.cpp4
-rw-r--r--src/keyboardconfig.h2
3 files changed, 14 insertions, 1 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;
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp
index 1976e803..8187bef7 100644
--- a/src/keyboardconfig.cpp
+++ b/src/keyboardconfig.cpp
@@ -96,7 +96,9 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = {
{"keyChatScrollUp", SDLK_PAGEUP, _("Scroll Chat Up")},
{"keyChatScrollDown", SDLK_PAGEDOWN, _("Scroll Chat Down")},
{"keyOK", SDLK_RETURN, _("Select OK")},
- {"keyQuit", SDLK_ESCAPE, _("Quit")}
+ {"keyQuit", SDLK_ESCAPE, _("Quit")},
+ {"keyIgnoreInput1", SDLK_LSUPER, _("Ignore input 1")},
+ {"keyIgnoreInput2", SDLK_RSUPER, _("Ignore input 2")}
};
void KeyboardConfig::init()
diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h
index 484c0c63..61d7887d 100644
--- a/src/keyboardconfig.h
+++ b/src/keyboardconfig.h
@@ -208,6 +208,8 @@ class KeyboardConfig
KEY_SCROLL_CHAT_DOWN,
KEY_OK,
KEY_QUIT,
+ KEY_IGNORE_INPUT_1,
+ KEY_IGNORE_INPUT_2,
KEY_TOTAL
};