From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49912 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhPJl-0001sN-N2 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 11:31:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhPJk-0000R9-C1 for qemu-devel@nongnu.org; Mon, 24 Jan 2011 11:31:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhPJk-0000Qe-3g for qemu-devel@nongnu.org; Mon, 24 Jan 2011 11:31:00 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0OGUwsp002350 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Jan 2011 11:30:59 -0500 From: Gerd Hoffmann Date: Mon, 24 Jan 2011 17:30:51 +0100 Message-Id: <1295886655-32312-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1295886655-32312-1-git-send-email-kraxel@redhat.com> References: <1295886655-32312-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [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: 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