From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0oRZ-0006Nq-Fe for qemu-devel@nongnu.org; Sun, 30 Oct 2016 07:38:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0oRW-0003QV-DN for qemu-devel@nongnu.org; Sun, 30 Oct 2016 07:38:29 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:43848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0oRW-0003QI-7O for qemu-devel@nongnu.org; Sun, 30 Oct 2016 07:38:26 -0400 Date: Sun, 30 Oct 2016 12:38:23 +0100 From: Samuel Thibault Message-ID: <20161030113823.GX3671@var.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Reduce curses escdelay from 1s to 0.2s List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kraxel@redhat.com 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 0.2s provides good enough user experience, while still allowing 200ms for keypad sequences to get in, which should be more than enough. Signed-off-by: Samuel Thibault --- rebased on master diff --git a/ui/curses.c b/ui/curses.c index 2e132a7..3599295 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -216,7 +216,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(); @@ -345,6 +345,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(200); /* Make color pair to match color format (3bits bg:3bits fg) */ for (i = 0; i < 64; i++) {