summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libdos.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-20 19:00:52 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-20 19:00:52 +0000
commit8ad4f44fa747a32e0d476971beeaf2c0550f16e5 (patch)
tree4cb0fa4b6f7cfc3fd7068ebee1564e1ade6bb2a6 /crawl-ref/source/libdos.cc
parent2d4c05e46de7f35c454f1dfbf3892ad589038a58 (diff)
downloadcrawl-ref-8ad4f44fa747a32e0d476971beeaf2c0550f16e5.tar.gz
crawl-ref-8ad4f44fa747a32e0d476971beeaf2c0550f16e5.zip
Experimental mouse support for ncurses (enable with mouse_input=yes in
.crawlrc). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1610 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libdos.cc')
-rw-r--r--crawl-ref/source/libdos.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/crawl-ref/source/libdos.cc b/crawl-ref/source/libdos.cc
index 8c197e1c8e..02e1b7f85c 100644
--- a/crawl-ref/source/libdos.cc
+++ b/crawl-ref/source/libdos.cc
@@ -93,4 +93,38 @@ int get_number_of_cols()
return (80);
}
+int getch_ck()
+{
+ int c = getch();
+ if (!c)
+ {
+ switch (c = getch())
+ {
+ case 'O': return CK_END;
+ case 'P': return CK_DOWN;
+ case 'I': return CK_PGUP;
+ case 'H': return CK_UP;
+ case 'G': return CK_HOME;
+ case 'K': return CK_LEFT;
+ case 'Q': return CK_PGDN;
+ case 'M': return CK_RIGHT;
+ case 119: return CK_CTRL_HOME;
+ case 141: return CK_CTRL_UP;
+ case 132: return CK_CTRL_PGUP;
+ case 116: return CK_CTRL_RIGHT;
+ case 118: return CK_CTRL_PGDN;
+ case 145: return CK_CTRL_DOWN;
+ case 117: return CK_CTRL_END;
+ case 115: return CK_CTRL_LEFT;
+ case 'S': return CK_DELETE;
+ }
+ }
+ return c;
+}
+
+int m_getch()
+{
+ return getch();
+}
+
#endif /* #if defined(DOS) */