From d268447e18c6e3edd80658f8f8d4317740c33af9 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Tue, 10 Feb 2009 20:09:33 -0700 Subject: Fixed header files, as well as removed the unused buddy list class (not useful since buddy lists are tracked through the player relation interface instead) Signed-off-by: Ira Rice --- src/keyboardconfig.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/keyboardconfig.h') diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h index bfcde31c..484c0c63 100644 --- a/src/keyboardconfig.h +++ b/src/keyboardconfig.h @@ -1,8 +1,9 @@ /* - * The Mana World + * Aethyra * Copyright (C) 2007 The Mana World Development Team * - * This file is part of The Mana World. + * This file is part of Aethyra based on original code + * from The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -- cgit v1.2.3-60-g2f50 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 +++++++++ src/keyboardconfig.cpp | 4 +++- src/keyboardconfig.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/keyboardconfig.h') 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 }; -- cgit v1.2.3-60-g2f50