diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-09-27 06:54:43 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-09-27 06:54:43 +0000 |
commit | 454214d486ffc95d985fe5e53d59563409bc03db (patch) | |
tree | f1f5ef72f2de9c77315a5d098070ea9d12e7cb1c | |
parent | be2310a6dbaa049e6f770f12b85f89f19a0ce9fa (diff) | |
download | crawl-ref-454214d486ffc95d985fe5e53d59563409bc03db.tar.gz crawl-ref-454214d486ffc95d985fe5e53d59563409bc03db.zip |
Fixed (well, hacked) *-direction and /-direction keypad handling for Unix.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@153 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/acr.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index d8e3bce25a..f9d59182e6 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -2557,6 +2557,18 @@ 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; @@ -2575,12 +2587,12 @@ keycode_type get_next_keycode() { if (keyin == '*') { keyin = getch(); // return control-key - return CONTROL(toupper(keyin)); + return CONTROL(toupper(numpad2vi(keyin))); } else if (keyin == '/') { keyin = getch(); // return shift-key - return toupper(keyin); + return toupper(numpad2vi(keyin)); } #else // Old DOS keypad support |