From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49270 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P7pFS-0007d6-Aq for qemu-devel@nongnu.org; Mon, 18 Oct 2010 08:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P7pFQ-0002rw-R4 for qemu-devel@nongnu.org; Mon, 18 Oct 2010 08:55:30 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:39031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P7pFQ-0002rm-KG for qemu-devel@nongnu.org; Mon, 18 Oct 2010 08:55:28 -0400 Message-ID: <4CBC43BD.1080406@msgid.tls.msk.ru> Date: Mon, 18 Oct 2010 16:55:25 +0400 From: Michael Tokarev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] USB keyboard emulation key mapping error - debian#578846 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Brad Jorsch writes ( http://bugs.debian.org/578846 ): 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. This indeed fixes the problem, which is indeed exist. 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 Signed-Off-By: Michael Tokarev diff --git a/hw/usb-hid.c b/hw/usb-hid.c --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -401,3 +401,3 @@ static const uint8_t usb_hid_usage_keys[0x100] = { 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,