summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/acr.cc16
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