qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Usb mouse fix
@ 2008-01-02 15:48 Daniel Godás
  0 siblings, 0 replies; only message in thread
From: Daniel Godás @ 2008-01-02 15:48 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1477 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1682 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-01-02 15:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-02 15:48 [Qemu-devel] Usb mouse fix Daniel Godás

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).