summaryrefslogtreecommitdiff
path: root/src/ncurses.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ncurses.cc')
-rw-r--r--src/ncurses.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ncurses.cc b/src/ncurses.cc
index a7c2a3e5..1cbfbf1f 100644
--- a/src/ncurses.cc
+++ b/src/ncurses.cc
@@ -211,6 +211,16 @@ struct getch_iterator
getch_iterator& operator++(int) { return *this; }
};
+bool NCursesUI::is_key_available()
+{
+ timeout(0);
+ const int c = getch();
+ if (c != ERR)
+ ungetch(c);
+ timeout(-1);
+ return c != ERR;
+}
+
Key NCursesUI::get_key()
{
const unsigned c = getch();