diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-03-03 18:25:57 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-03-11 08:39:01 +0100 |
commit | 633786fea79391c9cbf0d77cc028fa5c14d76657 (patch) | |
tree | 48437b97a06fedaa88d02c08efbd788e798bb5e7 /ui | |
parent | e2a18635a400b0e68679614132e9ef6316105590 (diff) | |
download | qemu-633786fea79391c9cbf0d77cc028fa5c14d76657.zip |
Reduce curses escdelay from 1s to 25ms
By default, curses will only report single ESC key event after 1s delay,
since ESC is also used for keypad escape sequences. This however makes
users believe that ESC is not working. Reducing to 25ms provides good user
experience, while still allowing 25ms for keypad sequences to get in, which
should be enough.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-Id: <20190303172557.17139-1-samuel.thibault@ens-lyon.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/curses.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/curses.c b/ui/curses.c index 6e0091c3b2..870273de51 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -231,7 +231,7 @@ static void curses_refresh(DisplayChangeListener *dcl) keycode = curses2keycode[chr]; keycode_alt = 0; - /* alt key */ + /* alt or esc key */ if (keycode == 1) { int nextchr = getch(); @@ -361,6 +361,7 @@ static void curses_setup(void) initscr(); noecho(); intrflush(stdscr, FALSE); nodelay(stdscr, TRUE); nonl(); keypad(stdscr, TRUE); start_color(); raw(); scrollok(stdscr, FALSE); + set_escdelay(25); /* Make color pair to match color format (3bits bg:3bits fg) */ for (i = 0; i < 64; i++) { |