From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55577 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdiFm-0001UG-7f for qemu-devel@nongnu.org; Fri, 14 Jan 2011 06:55:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdiFl-0005Hx-2I for qemu-devel@nongnu.org; Fri, 14 Jan 2011 06:55:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdiFk-0005Hl-Rr for qemu-devel@nongnu.org; Fri, 14 Jan 2011 06:55:37 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0EBtZkR012441 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Jan 2011 06:55:36 -0500 From: Gerd Hoffmann Date: Fri, 14 Jan 2011 12:55:29 +0100 Message-Id: <1295006132-29153-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1295006132-29153-1-git-send-email-kraxel@redhat.com> References: <1295006132-29153-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 4/7] vnc: fix numlock+capslock tracking List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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 -- 1.7.1