[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/9] hw/usb/dev-hid: Improve guest compatibility of u
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 1/9] hw/usb/dev-hid: Improve guest compatibility of usb-tablet |
Date: |
Mon, 6 Feb 2017 12:28:13 +0100 |
From: Phil Dennis-Jordan <address@hidden>
1. Set bInterfaceProtocol to 0x00 for usb-tablet. This should be
non-zero for boot protocol devices only, which the usb-tablet is not.
2. Set the usb-tablet's usage to "mouse" in the report descriptor.
The boot protocol of 0x02 specifically confused OS X/macOS' HID driver
stack, causing it to generate additional bogus HID events with relative
motion in addition to the tablet's absolute coordinate events.
Absolute pointing devices with HID Report Descriptor usage of 0x01
(pointing) are treated by the macOS HID driver as analog sticks, and
absolute coordinates are not directly translated to absolute mouse
cursor positions. Changing it to 0x02 (mouse) fixes the problem, and
does not have any adverse effect in other operating systems and
windowing systems. (VMWare does the same thing.)
Signed-off-by: Phil Dennis-Jordan <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/dev-hid.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c
index 24d05f7..dda0bf0 100644
--- a/hw/usb/dev-hid.c
+++ b/hw/usb/dev-hid.c
@@ -144,7 +144,7 @@ static const USBDescIface desc_iface_tablet = {
.bInterfaceNumber = 0,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_HID,
- .bInterfaceProtocol = 0x02,
+ .bInterfaceProtocol = 0x00,
.ndesc = 1,
.descs = (USBDescOther[]) {
{
@@ -174,7 +174,7 @@ static const USBDescIface desc_iface_tablet2 = {
.bInterfaceNumber = 0,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_HID,
- .bInterfaceProtocol = 0x02,
+ .bInterfaceProtocol = 0x00,
.ndesc = 1,
.descs = (USBDescOther[]) {
{
@@ -487,7 +487,7 @@ static const uint8_t qemu_mouse_hid_report_descriptor[] = {
static const uint8_t qemu_tablet_hid_report_descriptor[] = {
0x05, 0x01, /* Usage Page (Generic Desktop) */
- 0x09, 0x01, /* Usage (Pointer) */
+ 0x09, 0x02, /* Usage (Mouse) */
0xa1, 0x01, /* Collection (Application) */
0x09, 0x01, /* Usage (Pointer) */
0xa1, 0x00, /* Collection (Physical) */
--
1.8.3.1
- [Qemu-devel] [PULL 0/9] usb: various bugfixes, mostly xhci., Gerd Hoffmann, 2017/02/06
- [Qemu-devel] [PULL 8/9] usb: ccid: check ccid apdu length, Gerd Hoffmann, 2017/02/06
- [Qemu-devel] [PULL 3/9] usb: accept usb3 control requests, Gerd Hoffmann, 2017/02/06
- [Qemu-devel] [PULL 4/9] xhci: only free completed transfers, Gerd Hoffmann, 2017/02/06
- [Qemu-devel] [PULL 1/9] hw/usb/dev-hid: Improve guest compatibility of usb-tablet,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 7/9] xhci: guard xhci_kick_epctx against recursive calls, Gerd Hoffmann, 2017/02/06
- [Qemu-devel] [PULL 5/9] xhci: rename xhci_complete_packet to xhci_try_complete_packet, Gerd Hoffmann, 2017/02/06
- [Qemu-devel] [PULL 6/9] xhci: don't kick in xhci_submit and xhci_fire_ctl_transfer, Gerd Hoffmann, 2017/02/06
- [Qemu-devel] [PULL 2/9] usb/uas: more verbose error message, Gerd Hoffmann, 2017/02/06
- [Qemu-devel] [PULL 9/9] xhci: fix event queue IRQ handling, Gerd Hoffmann, 2017/02/06
- Re: [Qemu-devel] [PULL 0/9] usb: various bugfixes, mostly xhci., no-reply, 2017/02/06
- Re: [Qemu-devel] [PULL 0/9] usb: various bugfixes, mostly xhci., Peter Maydell, 2017/02/06