From mboxrd@z Thu Jan 1 00:00:00 1970 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 Message-ID: <4B215ADC.9050300@redhat.com> Date: Thu, 10 Dec 2009 21:32:28 +0100 From: Gerd Hoffmann MIME-Version: 1.0 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> Content-Type: multipart/mixed; boundary="------------070203070404070504010306" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------070203070404070504010306 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------070203070404070504010306 Content-Type: text/plain; name="fix" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix" 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); } --------------070203070404070504010306--