Enabling multitouch in input-evdev

Peter Hutterer peter.hutterer at who-t.net
Wed Jan 20 14:50:44 PST 2010


On Tue, Jan 19, 2010 at 11:12:32AM +0100, Benjamin Tissoires wrote:
> >as part of InitValuatorAxisStruct, the driver passes in an array of atoms
> >specifying the labels for the axes it announced. these are defined in
> >xserver-properties.h but are essentially free-form. so you can label them as
> >e.g. "Touchpoint1 X", "Touchpoint1 Y" (this needs to be put in the driver,
> >the current one doesn't do it).
> >you can then have the client ask the driver for the axis labels and if one
> >of the multi-touch axes is found, behave accordingly.
> >
> >there's no good way to label some device as "touchpad" and one shouldn't do
> >so (the driver has to for technical reasons) since chances are likely that
> >devices will turn up that are both touchpad and $OTHERDEVICE.
> And how about using properties ? In the Evdev driver, we do know the
> capabilities of the device with the fields pEvdev->flags. If we
> export this flag, the toolkit will be able to know the kind of
> device (EVDEV_TABLET, EVDEV_MULTITOUCH, EVDEV_BUTTON_EVENTS,
> EVDEV_TOUCHSCREEN, or / and EVDEV_TOUCHPAD)

these flags are mainly used as kludges where the driver behaviour needs to
be a bit different to what it otherwise is. exporting this to the client is
somewhat superfluous since the client sees all axes/buttons exported and
labeled.

I'm wary of exporting this given that the meaning of a flag may change even
within the same driver version.

> About Bradley's question:
> 
> >I have a laptop with the N-Trig digitizer, which is supposed to be
> >both a touchscreen and a tablet. The device isn't working 100% in
> >Linux yet, but it should be possible to (eventually) detect events
> >coming from the pen vs. from a finger. But again, how would one
> >pass this to the client?
> 
> Maybe we could copy the input-wacom driver: 2 devices, one for the
> pen, and one for the (multi)touch. I think in this case, it can be
> justified. But the point is that it will be more difficult to keep
> the driver generic...
 
This technique is currently the only one we have available if you want to be 
able to use both devices at the same time. It somewhat makes sense anyway
since they are two physical devices.

Cheers,
  Peter


More information about the xorg-devel mailing list