From patchwork Sun Mar 3 17:25:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 10837159 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F18951575 for ; Sun, 3 Mar 2019 17:35:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBFFC29B73 for ; Sun, 3 Mar 2019 17:35:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D053029CBF; Sun, 3 Mar 2019 17:35:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 43FF629B73 for ; Sun, 3 Mar 2019 17:35:52 +0000 (UTC) Received: from localhost ([127.0.0.1]:42303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0V1j-000550-Lt for patchwork-qemu-devel@patchwork.kernel.org; Sun, 03 Mar 2019 12:35:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0UsK-0006hn-98 for qemu-devel@nongnu.org; Sun, 03 Mar 2019 12:26:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0UsJ-00037A-JF for qemu-devel@nongnu.org; Sun, 03 Mar 2019 12:26:08 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:48404) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0UsJ-00036K-Bj for qemu-devel@nongnu.org; Sun, 03 Mar 2019 12:26:07 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 6C19E11703; Sun, 3 Mar 2019 18:26:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hhzyjt5LJt6v; Sun, 3 Mar 2019 18:26:03 +0100 (CET) Received: from function (dhcp-97-171.dsi-ext.ens-lyon.fr [140.77.97.171]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 7E2CA1171D; Sun, 3 Mar 2019 18:26:03 +0100 (CET) Received: from samy by function with local (Exim 4.92-RC6) (envelope-from ) id 1h0Us9-0004T8-W7; Sun, 03 Mar 2019 18:25:58 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Sun, 3 Mar 2019 18:25:57 +0100 Message-Id: <20190303172557.17139-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.233.100.1 Subject: [Qemu-devel] [PULLv2] Reduce curses escdelay from 1s to 25ms X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Thibault , kraxel@redhat.com, imp@bsdimp.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- ui/curses.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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++) {