From patchwork Thu Dec 10 20:32:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 40889 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 D30D5B6EFE for ; Fri, 11 Dec 2009 07:33:18 +1100 (EST) Received: from localhost ([127.0.0.1]:33470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIphL-0006hW-AM for incoming@patchwork.ozlabs.org; Thu, 10 Dec 2009 15:33:15 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIpgm-0006fD-1e for qemu-devel@nongnu.org; Thu, 10 Dec 2009 15:32:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIpgh-0006Zh-El for qemu-devel@nongnu.org; Thu, 10 Dec 2009 15:32:39 -0500 Received: from [199.232.76.173] (port=57070 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIpgh-0006ZW-5J for qemu-devel@nongnu.org; Thu, 10 Dec 2009 15:32:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60550) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIpgg-0000jO-TR for qemu-devel@nongnu.org; Thu, 10 Dec 2009 15:32:35 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBAKWWGQ007800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Dec 2009 15:32:33 -0500 Received: from zweiblum.home.kraxel.org (vpn2-9-140.ams2.redhat.com [10.36.9.140]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBAKWTv3015264 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 10 Dec 2009 15:32:31 -0500 Message-ID: <4B215ADC.9050300@redhat.com> Date: Thu, 10 Dec 2009 21:32:28 +0100 From: Gerd Hoffmann User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Lightning/1.0pre Thunderbird/3.0b4 MIME-Version: 1.0 To: Alexander Graf Subject: Re: [Qemu-devel] [PATCH] vnc: improve capslock handling. References: <1257162426-10349-1-git-send-email-kraxel@redhat.com> <4B210023.903@suse.de> In-Reply-To: <4B210023.903@suse.de> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: qemu-devel@nongnu.org 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 On 12/10/09 15:05, Alexander Graf wrote: > Gerd Hoffmann wrote: >> When capslock is toggled while the vnc window hasn't the focus qemu >> will miss the state change. Add sanity checks for the capslock state >> and toggle it if needed, so hosts and guests idea of capslock state >> stay in sync. Simliar logic for numlock is present in qemu already. >> >> Signed-off-by: Gerd Hoffmann >> > > This commit breaks the shift key in VNC for me. Does the attached patch fix it for you? Guess you are using vncviewer? cheers, Gerd diff --git a/vnc.c b/vnc.c index 32c4678..2e4fd40 100644 --- a/vnc.c +++ b/vnc.c @@ -1506,11 +1506,12 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) static void key_event(VncState *vs, int down, uint32_t sym) { int keycode; + int lsym = sym; - if (sym >= 'A' && sym <= 'Z' && is_graphic_console()) - sym = sym - 'A' + 'a'; + if (lsym >= 'A' && lsym <= 'Z' && is_graphic_console()) + lsym = lsym - 'A' + 'a'; - keycode = keysym2scancode(vs->vd->kbd_layout, sym & 0xFFFF); + keycode = keysym2scancode(vs->vd->kbd_layout, lsym & 0xFFFF); do_key_event(vs, down, keycode, sym); }