summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-04 13:19:22 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-04 13:19:22 +0000
commit5e88f223672ce4d126cfeb08544959eec9abb8a1 (patch)
treec2119f56f96d6cd8eec6e44dd900f88e340e56d7
parenta595b7fd82f3d7c054f4a28f6b2d5770e6aade15 (diff)
downloadcrawl-ref-5e88f223672ce4d126cfeb08544959eec9abb8a1.tar.gz
crawl-ref-5e88f223672ce4d126cfeb08544959eec9abb8a1.zip
Tweaks to try to fix numpad handling for Windows without blowing up support on
Unix. I need help testing this since I don't have a numpad. :-) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@783 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/acr.cc22
-rw-r--r--crawl-ref/source/libutil.cc24
2 files changed, 24 insertions, 22 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 486dd2f7d4..696d031e34 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2403,28 +2403,6 @@ command_type keycode_to_command( keycode_type key ) {
case '0': return CMD_NO_CMD;
-#ifdef UNIX
- case '1': return CMD_MOVE_DOWN_LEFT;
- case '2': return CMD_MOVE_DOWN;
- case '3': return CMD_MOVE_DOWN_RIGHT;
- case '4': return CMD_MOVE_LEFT;
- case '5': return CMD_REST;
- case '6': return CMD_MOVE_RIGHT;
- case '7': return CMD_MOVE_UP_LEFT;
- case '8': return CMD_MOVE_UP;
- case '9': return CMD_MOVE_UP_RIGHT;
-#else
- case '1': return CMD_RUN_DOWN_LEFT;
- case '2': return CMD_RUN_DOWN;
- case '3': return CMD_RUN_DOWN_RIGHT;
- case '4': return CMD_RUN_LEFT;
- case '5': return CMD_REST;
- case '6': return CMD_RUN_RIGHT;
- case '7': return CMD_RUN_UP_LEFT;
- case '8': return CMD_RUN_UP;
- case '9': return CMD_RUN_UP_RIGHT;
-#endif
-
case CONTROL('B'): return CMD_OPEN_DOOR_DOWN_LEFT;
case CONTROL('H'): return CMD_OPEN_DOOR_LEFT;
case CONTROL('J'): return CMD_OPEN_DOOR_DOWN;
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index 061113adc7..f59eab1ee7 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -104,6 +104,30 @@ int unmangle_direction_keys(int keyin, int km)
}
#endif
+ // [dshaligram] More lovely keypad mangling.
+ switch (keyin)
+ {
+#ifdef UNIX
+ case '1': return 'b';
+ case '2': return 'j';
+ case '3': return 'n';
+ case '4': return 'h';
+ case '6': return 'l';
+ case '7': return 'y';
+ case '8': return 'k';
+ case '9': return 'u';
+#else
+ case '1': return 'B';
+ case '2': return 'J';
+ case '3': return 'N';
+ case '4': return 'H';
+ case '6': return 'L';
+ case '7': return 'Y';
+ case '8': return 'K';
+ case '9': return 'U';
+#endif
+ }
+
return (keyin);
}