Commit graph

2 commits

Author SHA1 Message Date
Peter Hutterer
b1fc392268 udev: prepend the libinput group with the product string
Multiple devices plugged into the same USB hub have the same
PHYS path and are assigned to the same group.

Prepend the content of the PRODUCT env to the phys path, this at least ensures
that different devices are never grouped together.

https://bugs.freedesktop.org/show_bug.cgi?id=89802

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-23 09:07:44 +10:00
Peter Hutterer
2b2a1b0eb9 Add udev bits to assign LIBINPUT_DEVICE_GROUP
The easiest way to get a device group is by looking at the phys path of the
input device (which looks like usb-0000:00:14.0-1/input1) and dropping the
/inputX bit. The rest is the same for devices that belong together (except on
the Cintiq 22HD Touch).

Ideally we could just take ATTRS{phys} but we can't select substrings to drop
into ENV so we need to do it ourselves. This patch adds a callout that takes a
syspath and prints the mangled path, to be used in LIBINPUT_DEVICE_GROUP.

The rule triggers on any device that has a non-zero phys attribute, this
groups devices like tablets together but also devices like mice with multiple
interfaces.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-02-18 10:08:29 +10:00