From patchwork Tue Oct 19 17:48:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 68363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BD544B70AF for ; Wed, 20 Oct 2010 04:50:28 +1100 (EST) Received: from localhost ([127.0.0.1]:49442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8GKP-0006Be-Go for incoming@patchwork.ozlabs.org; Tue, 19 Oct 2010 13:50:25 -0400 Received: from [140.186.70.92] (port=59255 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8GIp-0005un-FU for qemu-devel@nongnu.org; Tue, 19 Oct 2010 13:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8GIb-00036o-Nw for qemu-devel@nongnu.org; Tue, 19 Oct 2010 13:48:47 -0400 Received: from solo.fdn.fr ([80.67.169.19]:51539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8GIb-000347-Jo for qemu-devel@nongnu.org; Tue, 19 Oct 2010 13:48:33 -0400 Received: from const.ipv6 (youpi.is-a-geek.org [80.67.176.89]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by solo.fdn.fr (Postfix) with ESMTPS id C5FB946855 for ; Tue, 19 Oct 2010 19:48:20 +0200 (CEST) Received: from samy by const.ipv6 with local (Exim 4.72) (envelope-from ) id 1P8GIO-0002o3-4w for qemu-devel@nongnu.org; Tue, 19 Oct 2010 19:48:20 +0200 Date: Tue, 19 Oct 2010 19:48:20 +0200 From: Samuel Thibault To: qemu-devel@nongnu.org Message-ID: <20101019174820.GA10718@const.famille.thibault.fr> References: <20100829232309.GD5158@const.famille.thibault.fr> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100829232309.GD5158@const.famille.thibault.fr> User-Agent: Mutt/1.5.12-2006-07-14 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] Re: [PATCH,curses] Fix control-{@[\]^_} and ESC X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hello, This apparently has been neither applied, nor commented on. Could either be done? Samuel control-{@[\]^_} shouldn't get the 'a' - 'A' offset for correct translation. ESC is better simulated as escape key. Signed-off-by: Samuel Thibault diff --git a/ui/curses.c b/ui/curses.c index ed3165e..5d949d6 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -238,9 +240,12 @@ static void curses_refresh(DisplayState *ds) keysym = curses2keysym[chr]; if (keysym == -1) { - if (chr < ' ') - keysym = (chr + '@' - 'A' + 'a') | KEYSYM_CNTRL; - else + if (chr < ' ') { + keysym = chr + '@'; + if (keysym >= 'A' && keysym <= 'Z') + keysym += 'a' - 'A'; + keysym |= KEYSYM_CNTRL; + } else keysym = chr; } diff --git a/ui/curses_keys.h b/ui/curses_keys.h index 1decd11..c0d5eb4 100644 --- a/ui/curses_keys.h +++ b/ui/curses_keys.h @@ -55,6 +55,7 @@ static const int curses2keysym[CURSES_KEYS] = { [0x7f] = KEY_BACKSPACE, ['\r'] = KEY_ENTER, ['\n'] = KEY_ENTER, + [27] = 27, [KEY_BTAB] = '\t' | KEYSYM_SHIFT, };