From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FaVwl-0005mH-6C for qemu-devel@nongnu.org; Mon, 01 May 2006 06:48:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FaVwk-0005lh-Gw for qemu-devel@nongnu.org; Mon, 01 May 2006 06:48:06 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FaVwk-0005ld-9X for qemu-devel@nongnu.org; Mon, 01 May 2006 06:48:06 -0400 Received: from [84.96.92.55] (helo=smtP.neuf.fr) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FaW0X-0006fz-BK for qemu-devel@nongnu.org; Mon, 01 May 2006 06:52:01 -0400 Received: from [84.102.211.147] by sp604004mt.gpm.neuf.ld (Sun Java System Messaging Server 6.2-5.05 (built Feb 16 2006)) with ESMTP id <0IYL00I9M205MH40@sp604004mt.gpm.neuf.ld> for qemu-devel@nongnu.org; Mon, 01 May 2006 12:48:05 +0200 (CEST) Date: Mon, 01 May 2006 12:47:21 +0200 From: Fabrice Bellard In-reply-to: <44558B4C.6080804@codemonkey.ws> Message-id: <4455E739.90300@bellard.org> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT References: <44558B4C.6080804@codemonkey.ws> Subject: [Qemu-devel] Re: [PATCH] Work around VNC clients that do not transmit shifts for uppercase characters Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Does it mean that the caps lock keysym is not transmitted by RealVNC ? Otherwise converting the upper case to case lower case would suffice. Fabrice. Anthony Liguori wrote: > The spec isn't really clear about what a client should do. This patch > is needed for RealVNC clients (at least). > > Regards, > > Anthony Liguori > > > ------------------------------------------------------------------------ > > # HG changeset patch > # User Anthony Liguori > # Node ID 8a71740fc36fcaf97e126e581847983cb2a4324d > # Parent a9314fc39a5e3d78d80d385f560c922c3ce0e82b > Fix for VNC clients that do not send Shift's for uppercase characters > > diff -r a9314fc39a5e -r 8a71740fc36f vnc.c > --- a/vnc.c Sun Apr 30 19:04:17 2006 -0500 > +++ b/vnc.c Sun Apr 30 23:12:48 2006 -0500 > @@ -591,11 +591,11 @@ static void pointer_event(VncState *vs, > } > } > > -static void key_event(VncState *vs, int down, uint32_t sym) > +static void key_event_post(kbd_layout_t *kbd_layout, int down, uint32_t sym) > { > int keycode; > > - keycode = keysym2scancode(vs->kbd_layout, sym & 0xFFFF); > + keycode = keysym2scancode(kbd_layout, sym & 0xFFFF); > > if (keycode & 0x80) > kbd_put_keycode(0xe0); > @@ -603,6 +603,22 @@ static void key_event(VncState *vs, int > kbd_put_keycode(keycode & 0x7f); > else > kbd_put_keycode(keycode | 0x80); > +} > + > +static void key_event(VncState *vs, int down, uint32_t sym) > +{ > + > + if (sym >= 'A' && sym <= 'Z') { > + sym = (sym - 'A') + 'a'; > + if (down) { > + key_event_post(vs->kbd_layout, 1, 0xffe1); > + key_event_post(vs->kbd_layout, 1, sym); > + key_event_post(vs->kbd_layout, 0, 0xffe1); > + return; > + } > + } > + > + key_event_post(vs->kbd_layout, down, sym); > } > > static void framebuffer_update_request(VncState *vs, int incremental,