From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FSj5d-0001kk-HJ for qemu-devel@nongnu.org; Sun, 09 Apr 2006 19:13:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FSj5c-0001kY-Dr for qemu-devel@nongnu.org; Sun, 09 Apr 2006 19:13:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FSj5c-0001kV-7f for qemu-devel@nongnu.org; Sun, 09 Apr 2006 19:13:04 -0400 Received: from [203.190.192.17] (helo=wasp.net.au) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FSjA7-0004KA-Hq for qemu-devel@nongnu.org; Sun, 09 Apr 2006 19:17:44 -0400 Message-ID: <4439954C.1050609@wasp.net.au> Date: Mon, 10 Apr 2006 03:14:20 +0400 From: Brad Campbell Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_wasp.net.au-4624-1144624379-0001-2" Subject: Re: [Qemu-devel] Gentlemen we have absolute movement! was:Absolute USB-HID device musings (was Re: VNC Terminal Server) References: <443802FB.9060700@win4lin.com> <44381AE0.1020106@wasp.net.au> <443825D8.3080602@win4lin.com> <443953D7.3060109@wasp.net.au> <44395575.1040303@austin.rr.com> <44395EE9.3040403@wasp.net.au> <44396E20.6010103@wasp.net.au> <4439753C.8080405@us.ibm.com> <44397848.1070707@wasp.net.au> <44397EFA.5070104@us.ibm.com> <44398445.4010602@wasp.net.au> <443985C3.1000206@us.ibm.com> In-Reply-To: <443985C3.1000206@us.ibm.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_wasp.net.au-4624-1144624379-0001-2 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 7bit Anthony Liguori wrote: > > Final one of the night. This patch disables relative mouse reporting > and disables grab automatically the first time SDL detects that the > absolute mouse was enabled. Needs a lot of cleanup but I'm very happy > with the user experience on this one. > Wish I'd just gone to bed now.. Heres a patch against your last one to implement wheel support. Brad -- "Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so." -- Douglas Adams --=_wasp.net.au-4624-1144624379-0001-2 Content-Type: text/plain; name="hid-wheel.patch"; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hid-wheel.patch" diff -ur qemu-clean/hw/usb-hid.c qemu/hw/usb-hid.c --- qemu-clean/hw/usb-hid.c 2006-04-10 02:57:46.000000000 +0400 +++ qemu/hw/usb-hid.c 2006-04-10 03:11:58.000000000 +0400 @@ -101,7 +101,7 @@ 0x00, /* u8 country_code */ 0x01, /* u8 num_descriptors */ 0x22, /* u8 type; Report */ - 53, 0, /* u16 len */ + 65, 0, /* u16 len */ /* one endpoint (status change endpoint) */ 0x07, /* u8 ep_bLength; */ @@ -145,14 +145,15 @@ 0x09, 0x31, /* Usage Y */ 0x15, 0x00, /* Logical Minimum 0 */ 0x27, 0xFF, 0xFF, 0x00, 0x00, /* Logical Maximum 0xffff */ - 0x75, 0x10, /* Report Size 32 */ + 0x75, 0x10, /* Report Size 16 */ 0x95, 0x02, /* Report Count 2 */ 0x81, 0x02, /* Input (Data, Var, Abs) */ -// 0x09, 0x32, /* Usage Z */ -// 0x15, 0x81, /* Logical Minimum -127 */ -// 0x25, 0x7F, /* Logical Maximum 127 */ -// 0x75, 0x08, /* Report Size 8 */ -// 0x95, 0x01, /* Report Count 1 */ + 0x09, 0x38, /* Usage Wheel */ + 0x15, 0x81, /* Logical Minimum -127 */ + 0x25, 0x7F, /* Logical Maximum 127 */ + 0x75, 0x08, /* Report Size 8 */ + 0x95, 0x01, /* Report Count 1 */ + 0x81, 0x02, /* Input (Data, Var, Rel) */ 0xC0, /* End Collection */ 0xC0, /* End Collection */ }; @@ -224,14 +225,18 @@ qemu_add_mouse_event_handler(NULL, NULL); absolute_mouse = 1; } - +/* dx = int_clamp(s->dx, -128, 127); dy = int_clamp(s->dy, -128, 127); - dz = int_clamp(s->dz, -128, 127); s->dx -= dx; s->dy -= dy; +*/ + + dz = int_clamp(s->dz, -128, 127); s->dz -= dz; +/* Appears we have to invert the wheel direction */ + dz = 0 - dz; b = 0; if (s->buttons_state & MOUSE_EVENT_LBUTTON) b |= 0x01; @@ -245,7 +250,8 @@ buf[2] = s->X >> 8; buf[3] = s->Y & 0xff; buf[4] = s->Y >> 8; - l = 5; + buf[5] = dz; + l = 6; return l; } --=_wasp.net.au-4624-1144624379-0001-2--