[haiku-development] Re: Tablets and messages

  • From: "x-otic@xxxxxxx" <x-otic@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 16 Dec 2010 11:26:10 +0100

On 16.12.2010 08:38, Enrique Medina Gremaldos wrote:
Ok, so I followed your advices, moved current driver to the trash and
implemented again as a usb_hid device. I've created a TabletDevice
subclassing ProtocolHandler and sent absolute coordinates using
tablet_movement structure instead. From user space land, I've just enabled
again TabletInputDevice (had to fix a pair of lines to get it working
again). All of this happened last two nights, so It is impressive to plug
usb digitizers on haiku and move the stylus around the desktop but still
tons of things to do, as handling properly clicks and check logs for
possible errors (there are some uhci token error :S).

The part I do not know how to go on, is the usb_hid detection. Currently If
device has X and Y items, It is a mouse device  , I obviously hacked this
part to get tablets working, but It is not clear to me what is the proper
way to detect a device and instantiate proper subclass (KeyboardDevice,
MouseDevice, TabletDevice, and maybe TouchScreenDevice :D )

Every USB HID device provides a HID descriptor, which indicates the usage of the device and which values it provides during usage. Please take a look at the related specs:
http://www.usb.org/developers/devclass_docs/usbmon10.pdf
http://www.usb.org/developers/devclass_docs/Hut1_12.pdf

Also, there is this stale patch (#6115), which might come in handy now. *cough* axeld *cough* It defines the neccessary B_HID_UID_DIG_TOUCH_PAD usage id and all the related stuff.

BR, Jürgen

Other related posts: