]> Git Repo - qemu.git/commitdiff
USB keyboard emulation key mapping error
authorMichael Tokarev <[email protected]>
Mon, 18 Oct 2010 12:55:25 +0000 (16:55 +0400)
committerAurelien Jarno <[email protected]>
Sun, 16 Jan 2011 18:52:48 +0000 (19:52 +0100)
The USB keyboard emulation's translation table in hw/usb-hid.c doesn't
match the codes actually sent for the Logo (a.k.a. "Windows") or Menu
keys. This results in the guest OS not being able to receive these keys
at all when the USB keyboard emulation is being used.

In particular, both the keymap in /usr/share/kvm/keymaps/modifiers and
the evdev table in x_keymap.c map these keys to 0xdb, 0xdc, and 0xdd,
while usb_hid_usage_keys[] seems to be expecting them to be mapped to
0x7d, 0x7e, and 0x7f.

The attached patch seems to fix the problem, at least in my (limited)
testing.

http://bugs.debian.org/578846
http://bugs.debian.org/600593 (cloned from the above against different pkg)
https://bugs.launchpad.net/qemu/+bug/584139

Signed-Off-By: Brad Jorsch <[email protected]>
Signed-Off-By: Michael Tokarev <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
hw/usb-hid.c

index 882d93346645ba79536aa03c899e3100ae7af9f1..e8de301a13c099625a22a7316eb489f8cad0e143 100644 (file)
@@ -399,7 +399,7 @@ static const uint8_t usb_hid_usage_keys[0x100] = {
     0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x4a,
     0x52, 0x4b, 0x00, 0x50, 0x00, 0x4f, 0x00, 0x4d,
     0x51, 0x4e, 0x49, 0x4c, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0xe3, 0xe7, 0x65, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
This page took 0.03013 seconds and 4 git commands to generate.