Adding support for a (multi-)touchscreen - where best to add it?

Matthew Helsley matt.helsley at gmail.com
Tue Mar 17 19:42:18 PDT 2009


On Sun, Mar 15, 2009 at 6:05 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> On Fri, Mar 13, 2009 at 06:21:04AM -0500, David Hagood wrote:
>> On Fri, 2009-03-13 at 11:43 +1000, Peter Hutterer wrote:
>> > On Thu, Mar 12, 2009 at 01:40:29PM -0400, Chris Ball wrote:
>>
>> > I agree. getting something sensible in the kernel prevents us from replicating
>> > the "one X driver per device" hilarity.
>> > Once we have that support in the kernel, we can look at how to get it to
>> > applications in a sensible manner. Real multi-touch is hard, and there are a
>> > few roadblocks that I'm not looking forward to.
>> >
>> > Cheers,
>> >   Peter
>>
>> OK, let me break it down into steps:
>>
>> Step 1: add the code to the kernel HID system to
>>   1a) identify this device as being a special case within the HID system
>>   1b) send the device the needed special packet to tell it to start
>> sending data (otherwise it does nothing).
>>   1c) Parse the incoming data (it uses a specific format) into HID
>> events.
>>
>> Alternatively 1a-1c could be done in a userspace library e.g. tslib.
>>
>> Step 2: Add support at the X input layer to handle those packets, in one
>> of the several candidate drivers (e.g. input-tslib, input-evtouch,
>> input-evdev).
>>   As I understand it the consensus here is that this should be in evdev.
>> NOTE: currently the other touchscreens I have from 3M and Dannotech do
>> NOT work under evdev - when evdev is bound to them it doesn't generate
>> any events to X. They do work under tslib and evtouch.
>
> that's probably because they advertise a button/axis combination that evdev
> does interpret correctly, or because they're posting the axis information
> wrongly. I had my hands on an HP Touchsmart for a short while and it was
> posting x/y through Z/Rx.

My Genius PenSketch tablet used to do the same thing. It turned out to
be a quirky HID descriptor which was fixed with the MULTI quirk. Once
I added that quirk it produced correct HID reports. You can try the
quirk with some simple sysfs manipulations or by writing a kernel
patch. I went the patch route and only noticed the sysfs method while
reading the code -- so I don't know the sysfs details. Other quirks
may apply.

Cheers,
    -Matt Helsley



More information about the xorg mailing list