From: "Leonardo E. Reiter" <lreiter@win4lin.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Absolute USB-HID device musings (was Re: VNC Terminal Server)
Date: Sat, 08 Apr 2006 17:06:32 -0400 [thread overview]
Message-ID: <443825D8.3080602@win4lin.com> (raw)
In-Reply-To: <44381AE0.1020106@wasp.net.au>
This is by no means a complete patch (do not apply it as it will break
usb-hid.c), but it adjusts the report descriptor in usb-hid.c to provide
position in 16-bits, and in absolute coordinates:
Index: usb-hid.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/usb-hid.c,v
retrieving revision 1.1
diff -a -u -r1.1 usb-hid.c
--- usb-hid.c 5 Nov 2005 16:57:08 -0000 1.1
+++ usb-hid.c 8 Apr 2006 20:56:02 -0000
@@ -117,7 +117,7 @@
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,
+ 0x25, 0x7F, 0x75, 0x16, 0x95, 0x02, 0x81, 0x02,
0xC0, 0xC0,
};
According to:
http://72.14.203.104/search?q=cache:wVYUTwc33f8J:www.usb.org/developers/devclass_docs/HID1_11.pdf+usb+hid+specification+absolute+relative&hl=en&gl=us&ct=clnk&cd=1
I'm still trying to figure out how the logical min/max apply if we are
to report absolute (unsigned) positions in 16-bits. Obviously 8-bits is
not enough for absolute coordinates. You could theoretically use only
12-bits per coordinate but that would make life difficult I think, and
probably unnecessarily frugal in a software emulation.
It's not clear to me [yet] how the scroll wheel comes into play, and
whether or not it (the dz coordinate) can be kept relative for ease of
implementation. Also the code would need to be changed to report
coordinates in 16-bits rather than 8, and of course made to report
absolute coordinates (like from sdl.c, etc.) Still it looks fairly easy
to implement - the USB spec is pretty simple.
So to reiterate, my patch does virtually nothing - in fact it will break
usb-hid.c so please don't use it. I was just illustrating how to get it
to report the device as providing 16-bit absolute coordinates instead of
8-bit relative ones. If anyone wants to chime in with more info, I'd be
glad to make this a discussion. *If* using the USB HID device only, not
any real USB devices, can be done without slowing down QEMU, then I
think this is a great way to get a tablet emulated without having to
deal with drivers on either side. Plus, in the long run, it probably
means other neat stuff like being able to get away from ISA bus
emulation, and also it's portable to other targets (for example, OS-X on
PPC would talk to the USB HID device the same way theoretically), so
it's likely the most portable and cleanest option.
Regards,
Leo Reiter
Brad Campbell wrote:
> Apparently USB HID supports absolute input devices natively. Given we
> have a HID mouse driver of sorts in qemu I wonder if that is another
> avenue perhaps ?
>
>
--
Leonardo E. Reiter
Vice President of Product Development, CTO
Win4Lin, Inc.
Virtual Computing from Desktop to Data Center
Main: +1 512 339 7979
Fax: +1 512 532 6501
http://www.win4lin.com
next prev parent reply other threads:[~2006-04-08 21:06 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-08 16:20 [Qemu-devel] VNC terminal server? Samuel Hunt
2006-04-08 18:12 ` Brad Campbell
2006-04-21 15:31 ` Troy Benjegerdes
2006-04-21 15:58 ` WaxDragon
2006-04-08 18:24 ` Johannes Schindelin
2006-04-08 18:37 ` Leonardo E. Reiter
2006-04-08 19:04 ` Johannes Schindelin
2006-04-08 19:15 ` Leonardo E. Reiter
2006-04-09 2:54 ` Anthony Liguori
2006-04-08 20:19 ` Brad Campbell
2006-04-08 20:29 ` Leonardo E. Reiter
2006-04-08 21:06 ` Leonardo E. Reiter [this message]
2006-04-08 21:18 ` [Qemu-devel] Absolute USB-HID device musings (was Re: VNC Terminal Server) Leonardo E. Reiter
2006-04-08 21:22 ` Brad Campbell
2006-04-08 21:36 ` Leonardo E. Reiter
2006-04-09 4:36 ` Anthony Liguori
2006-04-09 15:14 ` Jim C. Brown
2006-04-09 16:03 ` Leonardo E. Reiter
2006-04-09 16:49 ` Brad Campbell
2006-04-09 18:07 ` andrzej zaborowski
2006-04-09 18:35 ` Brad Campbell
2006-04-09 18:41 ` Lonnie Mendez
2006-04-09 19:22 ` Brad Campbell
2006-04-09 20:27 ` [Qemu-devel] Gentlemen we have absolute movement! was:Absolute " Brad Campbell
2006-04-09 20:31 ` Anthony Liguori
2006-04-09 20:57 ` Anthony Liguori
2006-04-09 21:02 ` Brad Campbell
2006-04-09 21:10 ` Brad Campbell
2006-04-09 21:20 ` Johannes Schindelin
2006-04-09 21:35 ` Brad Campbell
2006-04-09 21:39 ` Anthony Liguori
2006-04-09 22:01 ` Brad Campbell
2006-04-09 22:08 ` Anthony Liguori
2006-04-09 22:12 ` Brad Campbell
2006-04-09 22:18 ` Brad Campbell
2006-04-09 23:14 ` Brad Campbell
2006-04-10 3:40 ` [Qemu-devel] USB Tablet Emulation (was: Gentlemen we have absolute movement! was:Absolute USB-HID device musings (was Re: VNC Terminal Server)) Anthony Liguori
2006-04-10 8:23 ` [Qemu-devel] USB Tablet Emulation Brad Campbell
2006-04-10 8:32 ` Johannes Schindelin
2006-04-10 10:27 ` Brad Campbell
2006-04-10 11:27 ` Johannes Schindelin
2006-04-19 17:18 ` [Qemu-devel] USB Tablet Emulation + VNC patch Troy Benjegerdes
2006-04-21 21:13 ` Brad Campbell
2006-04-26 0:55 ` Troy Benjegerdes
2006-04-26 7:37 ` Brad Campbell
2006-04-10 14:58 ` [Qemu-devel] USB Tablet Emulation Leonardo E. Reiter
2006-04-10 15:27 ` Anthony Liguori
2006-04-10 15:39 ` Leonardo E. Reiter
2006-04-10 16:08 ` Brad Campbell
2006-04-10 19:28 ` Brad Campbell
2006-04-10 19:44 ` Brad Campbell
2006-04-10 21:27 ` Brad Campbell
2006-04-10 21:39 ` Brad Campbell
2006-04-08 18:38 ` [Qemu-devel] VNC terminal server? Mark Williamson
2006-04-08 18:53 ` Johannes Schindelin
2006-04-08 19:01 ` Jim C. Brown
2006-04-08 19:12 ` Johannes Schindelin
2006-04-08 19:30 ` Jim C. Brown
2006-04-08 19:40 ` Johannes Schindelin
2006-04-09 2:55 ` Anthony Liguori
2006-04-09 2:53 ` Anthony Liguori
2006-04-08 19:21 ` andrzej zaborowski
2006-04-08 19:33 ` Leonardo E. Reiter
2006-04-09 2:59 ` Anthony Liguori
2006-04-09 16:06 ` Leonardo E. Reiter
2006-04-09 16:40 ` Anthony Liguori
2006-04-09 2:57 ` Anthony Liguori
2006-04-09 2:52 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=443825D8.3080602@win4lin.com \
--to=lreiter@win4lin.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).