From patchwork Sun Mar 3 06:14:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 10836977 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 BF5711575 for ; Sun, 3 Mar 2019 07:45:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABC4E2A144 for ; Sun, 3 Mar 2019 07:45:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 993F12A148; Sun, 3 Mar 2019 07:45:11 +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 59D5B2A144 for ; Sun, 3 Mar 2019 07:45:10 +0000 (UTC) Received: from localhost ([127.0.0.1]:35556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0Lo5-00010B-2g for patchwork-qemu-devel@patchwork.kernel.org; Sun, 03 Mar 2019 02:45:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0Ln4-000070-PK for qemu-devel@nongnu.org; Sun, 03 Mar 2019 02:44:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0LfJ-0001N7-Jd for qemu-devel@nongnu.org; Sun, 03 Mar 2019 02:36:07 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:38126) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0LfJ-0001Ic-Aq for qemu-devel@nongnu.org; Sun, 03 Mar 2019 02:36:05 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 1677492C0; Sun, 3 Mar 2019 08:36:03 +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 r3ojn5kqNwqk; Sun, 3 Mar 2019 08:36:01 +0100 (CET) Received: from function (unknown [89.248.140.14]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6989492B1; Sun, 3 Mar 2019 08:36:01 +0100 (CET) Received: from samy by function with local (Exim 4.92-RC6) (envelope-from ) id 1h0KO1-0001zm-Da; Sun, 03 Mar 2019 07:14:09 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Sat, 2 Mar 2019 22:14:06 -0800 Message-Id: <20190303061406.7631-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] [PATCH] Reduce curses escdelay from 1s to 0.2s 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 , Gerd Hoffmann 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 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 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..700315bc09 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(200); /* Make color pair to match color format (3bits bg:3bits fg) */ for (i = 0; i < 64; i++) {