From patchwork Wed Jun 22 15:44:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 9193299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50362601C0 for ; Wed, 22 Jun 2016 16:33:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EE2028411 for ; Wed, 22 Jun 2016 16:33:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3374F28415; Wed, 22 Jun 2016 16:33:53 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C9F9A28411 for ; Wed, 22 Jun 2016 16:33:52 +0000 (UTC) Received: from localhost ([::1]:59689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFl67-0005ZX-Bm for patchwork-qemu-devel@patchwork.kernel.org; Wed, 22 Jun 2016 12:33:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFkkN-0002rx-AF for qemu-devel@nongnu.org; Wed, 22 Jun 2016 12:11:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFkkI-0007wb-4J for qemu-devel@nongnu.org; Wed, 22 Jun 2016 12:11:22 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:50616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFkkH-0007wU-T4 for qemu-devel@nongnu.org; Wed, 22 Jun 2016 12:11:18 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B6F558A78; Wed, 22 Jun 2016 18:11:10 +0200 (CEST) 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 DkbO1z5l-fxl; Wed, 22 Jun 2016 18:11:10 +0200 (CEST) Received: from var.youpi.perso.aquilenet.fr (unknown [82.98.7.198]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 82708895A; Wed, 22 Jun 2016 18:11:10 +0200 (CEST) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.87) (envelope-from ) id 1bFkKY-0005uJ-R3; Wed, 22 Jun 2016 17:44:42 +0200 From: Samuel Thibault To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Wed, 22 Jun 2016 17:44:38 +0200 Message-Id: <1466610278-22670-1-git-send-email-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.8.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 141.255.128.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 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 --- ui/curses.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/curses.c b/ui/curses.c index b475589..49d3ce6 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -222,7 +222,7 @@ static void curses_refresh(DisplayChangeListener *dcl) keycode = curses2keycode[chr]; keycode_alt = 0; - /* alt key */ + /* alt or esc key */ if (keycode == 1) { nextchr = getch(); @@ -349,6 +349,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++) {