diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-12 00:42:21 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-12 00:42:21 +0000 |
commit | 5ae26dde5e4e334ae902e23eb6791a9ef537f11e (patch) | |
tree | fd346d8ca24645095303422da9921643132ce91b /crawl-ref/source | |
parent | 510a5b2129d86a9c6591e701725379f6f1a6a67f (diff) | |
download | crawl-ref-5ae26dde5e4e334ae902e23eb6791a9ef537f11e.tar.gz crawl-ref-5ae26dde5e4e334ae902e23eb6791a9ef537f11e.zip |
[1909218] Fixing issue where keymaps were affecting menu choices done by keyboard or through the tiles mouse interface.
I couldn't think of any reason why keymaps should ever apply to menu selections (and certainly not the KC_DEFAULT map), so I added a new special keymap context called KC_NONE which doesn't apply keymaps to new input. This is used for all menus.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5739 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/macro.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/macro.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/menu.cc | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc index 74e294c4d7..2f2ad22ff3 100644 --- a/crawl-ref/source/macro.cc +++ b/crawl-ref/source/macro.cc @@ -641,8 +641,10 @@ int getchm(KeymapContext mc, int (*rgetch)()) // Read some keys... keyseq keys = getch_mul(rgetch); - // ... and add them into the buffer - macro_buf_add_long( keys, Keymaps[mc] ); + if (mc == KC_NONE) + macro_buf_add(keys); + else + macro_buf_add_long(keys, Keymaps[mc]); return (macro_buf_get()); } diff --git a/crawl-ref/source/macro.h b/crawl-ref/source/macro.h index 90d0557cda..1405cb7e19 100644 --- a/crawl-ref/source/macro.h +++ b/crawl-ref/source/macro.h @@ -29,7 +29,8 @@ enum KeymapContext { KC_TARGETING, // Only during 'x' and other targeting modes KC_CONFIRM, // When being asked y/n/q questions - KC_CONTEXT_COUNT // Must always be the last + KC_CONTEXT_COUNT, // Must always be the last real context + KC_NONE // Don't apply any keymaps (for menus) }; class key_recorder; diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index 82e43a0a76..3418517ea8 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -214,7 +214,7 @@ void Menu::do_menu() TileRedrawInv(REGION_INV2); mouse_control mc(MOUSE_MODE_COMMAND); #endif - int keyin = getchm(c_getch); + int keyin = getchm(KC_NONE, c_getch); if (!process_key( keyin )) return; |