summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilesdl.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-26 20:43:30 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-26 20:43:30 +0000
commit28aee35366609fba4f55a2e5528999f05a328cc5 (patch)
treee587db98a9bfc766c5b89c0170b40f8e09bcd360 /crawl-ref/source/tilesdl.cc
parent3dd428f3f253cc01f67f346d17fc6c5cb876d3d4 (diff)
downloadcrawl-ref-28aee35366609fba4f55a2e5528999f05a328cc5.tar.gz
crawl-ref-28aee35366609fba4f55a2e5528999f05a328cc5.zip
Experimentally mark the Alt key as unpressed everytime we get a
CMD_NO_CMD result with Tiles in case it's the result of the Alt-Tab bug. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10421 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilesdl.cc')
-rw-r--r--crawl-ref/source/tilesdl.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index 9a6fc6a5dd..0db1d9fdf0 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -7,6 +7,7 @@ REVISION("$Rev$");
#include "items.h"
#include "itemprop.h"
#include "files.h"
+#include "macro.h"
#include "message.h"
#include "mon-util.h"
#include "player.h"
@@ -825,6 +826,14 @@ int TilesFramework::getch_ck()
case SDL_KEYDOWN:
m_key_mod |= _get_modifiers(event.key.keysym);
key = _translate_keysym(event.key.keysym);
+ if (m_key_mod == MOD_ALT
+ && key_to_command(key, KMC_DEFAULT) == CMD_NO_CMD)
+ {
+ // If the Alt key is pressed and the command is invalid,
+ // try clearing the Alt key in case it got stuck in
+ // the stupid Windows/SDL bug with Alt-Tab.
+ m_key_mod &= ~MOD_ALT;
+ }
m_region_tile->place_cursor(CURSOR_MOUSE, Region::NO_CURSOR);
// If you hit a key, disable tooltips until the mouse