From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40451 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PioUk-00078l-TF for qemu-devel@nongnu.org; Fri, 28 Jan 2011 08:36:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PioUj-0000OE-Ju for qemu-devel@nongnu.org; Fri, 28 Jan 2011 08:36:10 -0500 Received: from mail-yw0-f45.google.com ([209.85.213.45]:48108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PioUj-0000O8-E5 for qemu-devel@nongnu.org; Fri, 28 Jan 2011 08:36:09 -0500 Received: by ywa8 with SMTP id 8so1165275ywa.4 for ; Fri, 28 Jan 2011 05:36:09 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4D42C645.1020502@redhat.com> Date: Fri, 28 Jan 2011 14:36:05 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1295886655-32312-1-git-send-email-kraxel@redhat.com> <1295886655-32312-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1295886655-32312-5-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 4/8] vnc: fix numlock+capslock tracking List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On 01/24/2011 05:30 PM, Gerd Hoffmann wrote: > This patch makes the numlock+capslock tracking logic only look at > keydown events. Without this patch the vnc server will insert > bogous capslock keypress in case it sees the following key sequence: > > shift down --- 'A' down --- shift up --- 'A' up > ^ here > > It doesn't hurt with a PS/2 keyboard, but it disturbs the USB Keyboard. > And with the key event queue just added to the usb keyboard the guest > will actually notice. > > Signed-off-by: Gerd Hoffmann > --- > ui/vnc.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ui/vnc.c b/ui/vnc.c > index 495d6d6..0820d99 100644 > --- a/ui/vnc.c > +++ b/ui/vnc.c > @@ -1504,7 +1504,7 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) > break; > } > > - if (vs->vd->lock_key_sync&& > + if (down&& vs->vd->lock_key_sync&& > keycode_is_keypad(vs->vd->kbd_layout, keycode)) { > /* If the numlock state needs to change then simulate an additional > keypress before sending this one. This will happen if the user > @@ -1523,7 +1523,7 @@ static void do_key_event(VncState *vs, int down, int keycode, int sym) > } > } > > - if (vs->vd->lock_key_sync&& > + if (down&& vs->vd->lock_key_sync&& > ((sym>= 'A'&& sym<= 'Z') || (sym>= 'a'&& sym<= 'z'))) { > /* If the capslock state needs to change then simulate an additional > keypress before sending this one. This will happen if the user This should be 1/8 or 2/8 in the series. Also, perhaps these four could go in 0.14? The USB device are really much more usable (especially the keyboard) with them. Paolo