]> Git Repo - qemu.git/commitdiff
Reduce curses escdelay from 1s to 25ms
authorSamuel Thibault <[email protected]>
Sun, 3 Mar 2019 17:25:57 +0000 (18:25 +0100)
committerGerd Hoffmann <[email protected]>
Mon, 11 Mar 2019 07:39:01 +0000 (08:39 +0100)
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 <[email protected]>
Message-Id: <20190303172557[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
ui/curses.c

index 6e0091c3b2865ecf05549083ca604c9b910fa2da..870273de51a98b8485a9d51c792b75225b29e2f0 100644 (file)
@@ -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++) {
This page took 0.026903 seconds and 4 git commands to generate.