diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-29 10:52:38 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-29 10:52:38 +0000 |
commit | 5bafe6551f12b7df0b5fe8ffad2f5f4ab3836718 (patch) | |
tree | 570284c09b5d48dc955102ea9b12ed77639b4c01 /crawl-ref/source/acr.cc | |
parent | 1acc5c3b399b756f29c5f458e915052f890c266c (diff) | |
download | crawl-ref-5bafe6551f12b7df0b5fe8ffad2f5f4ab3836718.tar.gz crawl-ref-5bafe6551f12b7df0b5fe8ffad2f5f4ab3836718.zip |
[1622126] Fixed shift+direction keys canceling the targeting prompt. Hopefully
this works on Windows and DOS, but I'm unsure.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@723 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 62 |
1 files changed, 2 insertions, 60 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index d3f491f4a8..8b88aaf21a 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -166,7 +166,6 @@ static void input(); static void middle_input(); static void world_reacts(); static command_type get_next_cmd(); -typedef int keycode_type; static keycode_type get_next_keycode(); static command_type keycode_to_command( keycode_type key ); @@ -2451,72 +2450,15 @@ command_type keycode_to_command( keycode_type key ) { } } -#ifdef UNIX -static keycode_type numpad2vi(keycode_type key) -{ - if (key >= '1' && key <= '9') - { - const char *vikeys = "bjnh.lyku"; - return keycode_type(vikeys[key - '1']); - } - return (key); -} -#endif - keycode_type get_next_keycode() { - keycode_type keyin; flush_input_buffer( FLUSH_BEFORE_COMMAND ); - keyin = getch_with_command_macros(); - -#ifdef UNIX - // Kludging running and opening as two character sequences - // for Unix systems. This is an easy way out... all the - // player has to do is find a termcap and numlock setting - // that will get curses the numbers from the keypad. This - // will hopefully be easy. - - /* can we say yuck? -- haranp */ - if (keyin == '*') - { - keyin = getch(); - // return control-key - keyin = CONTROL(toupper(numpad2vi(keyin))); - } - else if (keyin == '/') - { - keyin = getch(); - // return shift-key - keyin = toupper(numpad2vi(keyin)); - } -#else - // Old DOS keypad support - if (keyin == 0) - { - /* FIXME haranp - hackiness */ - const char DOSidiocy[10] = { "OPQKSMGHI" }; - const char DOSunidiocy[10] = { "bjnh.lyku" }; - const int DOScontrolidiocy[9] = { - 117, 145, 118, 115, 76, 116, 119, 141, 132 - }; - keyin = getch(); - for (int j = 0; j < 9; ++j ) { - if (keyin == DOSidiocy[j]) { - keyin = DOSunidiocy[j]; - break; - } - if (keyin == DOScontrolidiocy[j]) { - keyin = CONTROL(toupper(DOSunidiocy[j])); - break; - } - } - } -#endif + keyin = unmangle_direction_keys(getch_with_command_macros()); mesclr(); - return keyin; + return (keyin); } static void middle_input() { |