summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0001d9f)
raw | patch | inline | side by side (parent: 0001d9f)
author | Max Kellermann <max.kellermann@gmail.com> | |
Mon, 20 Mar 2017 16:16:35 +0000 (17:16 +0100) | ||
committer | Max Kellermann <max.kellermann@gmail.com> | |
Mon, 20 Mar 2017 16:16:35 +0000 (17:16 +0100) |
src/screen_utils.c | patch | blob | history |
diff --git a/src/screen_utils.c b/src/screen_utils.c
index 28d5e4b2fd4319384bf117178213f40f030485fa..891b9b3cb61bac1f673d1d45908712839d84f09d 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
flash();
}
+static bool
+ignore_key(int key)
+{
+ return key == ERR;
+}
+
int
screen_getch(const char *prompt)
{
curs_set(1);
int key;
- while ((key = wgetch(w)) == ERR)
- ;
+ while (ignore_key(key = wgetch(w))) {}
#ifdef HAVE_GETMOUSE
/* ignore mouse events */