[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/7] vnc: fix numlock+capslock tracking
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 4/7] vnc: fix numlock+capslock tracking |
Date: |
Fri, 14 Jan 2011 12:55:29 +0100 |
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 <address@hidden>
---
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
- [Qemu-devel] [PATCH 0/7] usb: add migration support., Gerd Hoffmann, 2011/01/14
- [Qemu-devel] [PATCH 4/7] vnc: fix numlock+capslock tracking,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 2/7] usb keyboard: add event event queue, Gerd Hoffmann, 2011/01/14
- [Qemu-devel] [PATCH 3/7] usb hid: move head+n to common struct, Gerd Hoffmann, 2011/01/14
- [Qemu-devel] [PATCH 6/7] usb hub: add migration support, Gerd Hoffmann, 2011/01/14
- [Qemu-devel] [PATCH 1/7] add event queueing to USB HID, Gerd Hoffmann, 2011/01/14
- [Qemu-devel] [PATCH 7/7] usb hid: add migration support, Gerd Hoffmann, 2011/01/14
- [Qemu-devel] [PATCH 5/7] usb core: add migration support, Gerd Hoffmann, 2011/01/14