From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FSgZX-0006BX-56 for qemu-devel@nongnu.org; Sun, 09 Apr 2006 16:31:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FSgZU-0006BL-Tv for qemu-devel@nongnu.org; Sun, 09 Apr 2006 16:31:46 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FSgZU-0006BI-NZ for qemu-devel@nongnu.org; Sun, 09 Apr 2006 16:31:44 -0400 Received: from [32.97.110.153] (helo=e35.co.us.ibm.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FSgdy-00048M-RU for qemu-devel@nongnu.org; Sun, 09 Apr 2006 16:36:23 -0400 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k39KVgXC023098 for ; Sun, 9 Apr 2006 16:31:42 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k39KSGfN259404 for ; Sun, 9 Apr 2006 14:28:16 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id k39KVg58009703 for ; Sun, 9 Apr 2006 14:31:42 -0600 Received: from [9.65.99.45] (sig-9-65-99-45.mts.ibm.com [9.65.99.45]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id k39KVfuD009682 for ; Sun, 9 Apr 2006 14:31:41 -0600 Message-ID: <44396F2A.1090508@us.ibm.com> Date: Sun, 09 Apr 2006 15:31:38 -0500 From: Anthony Liguori MIME-Version: 1.0 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> In-Reply-To: <44396E20.6010103@wasp.net.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 That's absolutely awesome Brad! Good job! I'll see how it works with the new Xorg driver. Regards, Anthony Liguori Brad Campbell wrote: > Brad Campbell wrote: >> Lonnie Mendez wrote: >> >>> Please see the patch posted yesterday to this mailing list: >>> >>> http://gnome.dnsalias.net/patches/qemu-hidmousexp.patch >> >> Ta for that.. not sure how I missed it. >> Now to try and get it to work.. >> > > Ok.. 1st cut.. it's not great, and it's not hooked up to anything at > the moment (the mouse just tootles around the screen on a timer) BUT! > we have absolute movement. > > The *stunning* news is it's resolution independent.. 640x480 - 800x600 > - 1024x768 > 0,0 is top left and 7fff.7fff is bottom right.. no client scaling > required.. > > Think I've figured out the Z axis thing also.. and we are good for > relative movement on that still > (The Z axis below is way wrong, but I think I have figured it out) > > static const uint8_t qemu_mouse_hid_report_descriptor[] = { > 0x05, 0x01, /* Usage Page Generic Desktop */ > 0x09, 0x01, /* Usage Mouse */ > 0xA1, 0x01, /* Collection Application */ > 0x09, 0x01, /* Usage Pointer */ > 0xA1, 0x00, /* Collection Physical */ > 0x05, 0x09, /* Usage Page Button */ > 0x19, 0x01, /* Usage Minimum Button 1 */ > 0x29, 0x03, /* Usage Maximum Button 3 */ > 0x15, 0x00, /* Logical Minimum 0 */ > 0x25, 0x01, /* Logical Maximum 1 */ > 0x95, 0x03, /* Report Count 3 */ > 0x75, 0x01, /* Report Size 1 */ > 0x81, 0x02, /* Input (Data, Var, Abs) */ > 0x95, 0x01, /* Report Count 1 */ > 0x75, 0x05, /* Report Size 5 */ > 0x81, 0x01, /* Input (Cnst, Var, Abs) */ > 0x05, 0x01, /* Usage Page Generic Desktop */ > 0x09, 0x30, /* Usage X */ > 0x09, 0x31, /* Usage Y */ > 0x15, 0x00, /* Logical Minimum 0 */ > 0x27, 0xFF, 0xFF, 0x00, 0x00, /* Logical Maximum 0xffff */ > 0x75, 0x10, /* Report Size 32 */ > 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 */ > 0xC0, /* End Collection */ > 0xC0, /* End Collection */ > }; > #endif > > static int usb_mouse_poll(USBMouseState *s, uint8_t *buf, int len) > { > int dx, dy, dz, b, l, aa, bb, cc, dd; > > 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; > s->dz -= dz; > b = 0; > if (s->buttons_state & MOUSE_EVENT_LBUTTON) > b |= 0x01; > if (s->buttons_state & MOUSE_EVENT_RBUTTON) > b |= 0x02; > if (s->buttons_state & MOUSE_EVENT_MBUTTON) > b |= 0x04; > > buf[0] = b; > buf[1] = s->X & 0xff; > buf[2] = s->X >> 8; > buf[3] = s->Y & 0xff; > buf[4] = s->Y >> 8; > aa=buf[1]; > bb=buf[2]; > cc=buf[3]; > dd=buf[4]; > l = 5; > > return l; > } >