diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-20 19:00:52 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-20 19:00:52 +0000 |
commit | 8ad4f44fa747a32e0d476971beeaf2c0550f16e5 (patch) | |
tree | 4cb0fa4b6f7cfc3fd7068ebee1564e1ade6bb2a6 /crawl-ref/source/macro.cc | |
parent | 2d4c05e46de7f35c454f1dfbf3892ad589038a58 (diff) | |
download | crawl-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/macro.cc')
-rw-r--r-- | crawl-ref/source/macro.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc index 4f9e8cbf45..0deb31ae04 100644 --- a/crawl-ref/source/macro.cc +++ b/crawl-ref/source/macro.cc @@ -44,6 +44,7 @@ #include <cctype> // for tolower #include <cstdlib> +#include "cio.h" #include "externs.h" #include "stuff.h" @@ -577,7 +578,7 @@ static keyseq getch_mul( int (*rgetch)() = NULL ) int a; if (!rgetch) - rgetch = getch; + rgetch = m_getch; keys.push_back( a = rgetch() ); @@ -655,16 +656,14 @@ void flush_input_buffer( int reason ) void macro_add_query( void ) { - unsigned char input; + int input; bool keymap = false; KeymapContext keymc = KC_DEFAULT; mesclr(); - mpr( "(m)acro, keymap [(k) default, (x) level-map or (t)argeting], (s)ave?", MSGCH_PROMPT ); - input = getch(); - if (input == 0) - input = getch(); - + mpr("(m)acro, keymap [(k) default, (x) level-map or (t)argeting], (s)ave?", + MSGCH_PROMPT); + input = m_getch(); input = tolower( input ); if (input == 'k') { @@ -714,9 +713,7 @@ void macro_add_query( void ) mprf(MSGCH_WARN, "Current Action: %s", vtostr(mapref[key]).c_str()); mpr( "Do you wish to (r)edefine, (c)lear, or (a)bort?", MSGCH_PROMPT ); - input = getch(); - if (input == 0) - input = getch(); + input = m_getch(); input = tolower( input ); if (input == 'a' || input == ESCAPE) |