qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Usb mouse fix


From: Daniel Godás
Subject: [Qemu-devel] Usb mouse fix
Date: Wed, 2 Jan 2008 16:48:47 +0100

Hi,

i think ive found a little bug on the usb mouse emulation (only with the mouse, not the tablet), the wheel doesnt seem to work (it just doesnt do anything). Ive tracked the problem down to usb-hid.c:

static const uint8_t qemu_mouse_hid_report_descriptor[] = {
    0x05, 0x01, 0x09, 0x02, 0xA1, 0x01, 0x09, 0x01,
0xA1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x03,
0x15, 0x00, 0x25, 0x01, 0x95, 0x03, 0x75, 0x01,
0x81, 0x02, 0x95, 0x01, 0x75, 0x05, 0x81, 0x01,
0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81,
0x25, 0x7F, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06,
0xC0, 0xC0,
};
That descriptor doesnt contain a 'wheel' section so when the virtualized OS gives me the TD it only has space for dx and dy and not for the wheel delta (its got a maximum length of 3). To fix the problem i just modified the descriptor, here is the new one:

static const uint8_t qemu_mouse_hid_report_descriptor[] = {
    0x05, 0x01, 0x09, 0x02, 0xA1, 0x01, 0x09, 0x01,
0xA1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x03,
0x15, 0x00, 0x25, 0x01, 0x95, 0x03, 0x75, 0x01,
0x81, 0x02, 0x95, 0x01, 0x75, 0x05, 0x81, 0x01,
0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81,
0x25, 0x7F, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06,
0x05, 0x01, 0x09, 0x38, 0x15, 0x81, 0x25, 0x7F,
0x35, 0x00, 0x45, 0x00, 0x75, 0x08, 0x95, 0x01,
0x81, 0x02, 0xC0, 0xC0,
};
Now the virtualized OS gives me a TD with a maximum length of 4 and the wheel works just fine.

Cheers,
Daniel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]