diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-04-14 15:18:13 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-04-21 00:15:42 +0000 |
commit | 467266bbb4cd208ecf163a6461bad1e47b5e6872 (patch) | |
tree | fa35ea75de909b149641d93835b9b813609f3d8e /src | |
parent | 16d5d78a4d369286ec0136e0a4310ab0f4536add (diff) |
touchpad: a touchpad with only one button is a clickpad
There is only one touchpad with a physical left button but no right button and
that is the old Apple touchpad, discontinued in 2008. Not a huge number of
those left, I assume.
So let's change our assumptions because these days the vast majority of
touchpads are clickpads - any touchpad that only has a left button is treated
as clickpad, even where the kernel doesn't set the INPUT_PROP_BUTTONPAD.
We do need to check for BTN_LEFT as well though, because Wacom touchpads (i.e.
the touch part of non-integrated Wacom tablets) don't have a left button
either.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/evdev-mt-touchpad-buttons.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c index d7f075c0..be399bc7 100644 --- a/src/evdev-mt-touchpad-buttons.c +++ b/src/evdev-mt-touchpad-buttons.c @@ -943,9 +943,22 @@ tp_guess_clickpad(const struct tp_dispatch *tp, struct evdev_device *device) has_middle = libevdev_has_event_code(device->evdev, EV_KEY, BTN_MIDDLE), has_right = libevdev_has_event_code(device->evdev, EV_KEY, BTN_RIGHT); - is_clickpad = libevdev_has_property(device->evdev, INPUT_PROP_BUTTONPAD); + /* A non-clickpad without a right button is a clickpad, assume the + * kernel is wrong. + * Exceptions here: + * - The one-button Apple touchpad (discontinued in 2008) has a + * single physical button + * - Wacom touch devices have neither left nor right buttons + */ + if (!is_clickpad && has_left && !has_right && + (tp->device->model_flags & EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON) == 0) { + evdev_log_bug_kernel(device, + "missing right button, assuming it is a clickpad.\n"); + is_clickpad = true; + } + if (has_middle || has_right) { if (is_clickpad) evdev_log_bug_kernel(device, |