Enabling multitouch in input-evdev

Peter Hutterer peter.hutterer at who-t.net
Tue Jan 19 01:37:46 PST 2010

On Tue, Jan 19, 2010 at 10:04:53AM +0100, Bradley T. Hughes wrote:
> On 01/19/2010 09:43 AM, ext Peter Hutterer wrote:
> >>>given the easy case of a single user interacting with a surface:
> >>>with Qt as it is now, if you get all the coordinates in a single XI2 event,
> >>>would that work for you? or is there extra information you need?
> >>
> >>That should work. Ideally I would like to also get some kind of
> >>indication from the device that it is a touch device, and what kind
> >>of touch device it is (it is a touchscreen or a touchpad? for
> >>example, we treat them slightly differently).
> >
> >Well, given the right axis labels that's the indication then :)
> Can you give me an example? Right now, I'm struggling with finding
> out how to get this information from the evdev driver to the client.

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.


More information about the xorg-devel mailing list