]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev: if a tablet has BTN_0, label it as ID_INPUT_TABLET_PAD
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 17 Sep 2020 03:06:19 +0000 (13:06 +1000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 17 Sep 2020 08:14:25 +0000 (10:14 +0200)
commit9aa5c971581de41ea5d479503dc0c4a3fa1b86de
tree92ad09da0b1c2527901d81ee257d0afac8627366
parent3dd8ae5c70aaf5d6d70079b1b14f1a66cb6b633a
udev: if a tablet has BTN_0, label it as ID_INPUT_TABLET_PAD

Graphics tablet devices comprise multiple event nodes, usually a Pen, Finger
and Pad node (that's how the kernel postfixes them). Pen and Pad are labeled
as ID_INPUT_TABLET but the pad doesn't actually send stylus events - it
doesn't usually have BTN_TOOL_PEN, merely BTN_STYLUS.

For the last several years, libwacom has set ID_INPUT_TABLET_PAD for all pad
devices known to it based on vid/pid and a "* Pad" name match. That does not
cover devices not in libwacom. libinput relies on ID_INPUT_TABLET_PAD to
initialize the pad backend.

We can't drop ID_INPUT_TABLET without breaking userspace, but we can add
ID_INPUT_TABLET_PAD ourselves - where a device has BTN_0 in addition to
BTN_STYLUS, let's add it as a pad.

There are some devices (notably: bamboos) that use BTN_LEFT instead of BTN_0
but they are relatively rare and there's a risk of mislabeling those devices,
so let's just stick with BTN_0 only.
src/udev/udev-builtin-input_id.c