From patchwork Thu Mar 7 15:11:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10843125 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 D94B21575 for ; Thu, 7 Mar 2019 15:15:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C48F728D59 for ; Thu, 7 Mar 2019 15:15:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8EA42E2E1; Thu, 7 Mar 2019 15:15:32 +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 5ED8428D59 for ; Thu, 7 Mar 2019 15:15:32 +0000 (UTC) Received: from localhost ([127.0.0.1]:53570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1uk7-0002Za-HV for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Mar 2019 10:15:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1ugW-0007at-ST for qemu-devel@nongnu.org; Thu, 07 Mar 2019 10:11:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1ugV-0002zh-PY for qemu-devel@nongnu.org; Thu, 07 Mar 2019 10:11:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52628) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1ugV-0002zF-Ie for qemu-devel@nongnu.org; Thu, 07 Mar 2019 10:11:47 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D7DC03001572; Thu, 7 Mar 2019 15:11:46 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 498CC5C545; Thu, 7 Mar 2019 15:11:42 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7259617475; Thu, 7 Mar 2019 16:11:41 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 16:11:35 +0100 Message-Id: <20190307151141.6483-2-kraxel@redhat.com> In-Reply-To: <20190307151141.6483-1-kraxel@redhat.com> References: <20190307151141.6483-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 07 Mar 2019 15:11:46 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/7] 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: libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Gerd Hoffmann , Samuel Thibault , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Samuel Thibault 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 Message-Id: <20190303172557.17139-1-samuel.thibault@ens-lyon.org> Signed-off-by: Gerd Hoffmann --- ui/curses.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/curses.c b/ui/curses.c index 6e0091c3b286..870273de51a9 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++) {