summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.cc
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 /crawl-ref/source/libutil.cc
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
Diffstat (limited to 'crawl-ref/source/libutil.cc')
-rw-r--r--crawl-ref/source/libutil.cc24
1 files changed, 24 insertions, 0 deletions
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);
}