libinput/doc/user
Peter Hutterer a7e4cbc212 quirks: allow overriding of AttrEventCode and AttrInputProp
This switches the quirk from AttrEventCodeEnable/Disable to just
AttrEventCode with a +/- prefix for each entry.
This switches the quirk from AttrInputPropEnable/Disable to just
AttrInputProp with a +/- prefix for each entry.

Previously, both event codes and input props would only apply the
last-matching section entry for a device. Furthermore, an earlier Disable entry
would take precedence over a later Enable entry. For example, a set of
sections with these lines *should* enable left, right and middle:

  [first]
  AttrEventCodeEnable=BTN_LEFT;BTN_RIGHT;BTN_MIDDLE

  [second]
  AttrEventCodeDisable=BTN_RIGHT

  [third]
  AttrEventCodeEnable=BTN_LEFT;BTN_RIGHT;

Alas: the first line was effectively ignored (quirks only returned the
last-matching one, i.e. the one from "third"). And due to implementation
details in evdev.c, the Disable attribute was processed after Enable,
i.e. the device was enabled for left + right and then disabled for
right. As a result, the device only had BTN_LEFT enabled.

Fix this by changing the attribute to carry both enable/disable
information and merging the commands together.

Internally, all quirks matching a device are simply ref'd into an array
in the struct quirks. The applied value is simply the last entry in the
array corresponding to our quirk.

For AttrEventCode and AttrInputProp instead do this:
- switch them to a tuple with the code as first entry and a boolean
  enable/disable as second entry
- if the struct quirk already has an entry for either, append the more
  recent one to the existing entry (instead of creating a new entry in
  the array). This way we have all entries that match and in-order of
  precedence - i.e. we can process them left-to-right to end up
  with the right state.

Fixes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/821

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-11-28 08:25:41 +10:00
..
dot doc/user: some rewording and improvements 2018-07-31 16:16:16 +10:00
svg Remove trailing whitespaces in the tree 2022-11-25 10:08:20 +10:00
404.rst doc/user: add custom 404 pages for the old links 2018-08-03 11:18:14 +10:00
absolute-axes.rst doc/user: correct some small typos 2018-08-19 11:54:52 -05:00
absolute-coordinate-ranges.rst doc/user: fix a link to the system hwdb file 2021-04-29 10:30:49 +10:00
architecture.rst dox: switch to sphinx for the user-visible documentation 2018-07-30 12:24:04 +10:00
building.rst doc/user: make "verifying install" command portable 2021-07-26 12:35:33 +02:00
button-debouncing.rst doc/user: rename filenames with underscores to dashes 2018-08-02 11:22:11 +10:00
clickpad-softbuttons.rst doc/user: more documentation cleanups and fixes 2018-08-01 10:07:28 +10:00
clickpad-with-right-button.rst quirks: allow overriding of AttrEventCode and AttrInputProp 2022-11-28 08:25:41 +10:00
conf.py.in doc/user: explicitly specify language as en 2022-11-22 14:26:44 +10:00
configuration.rst touchpad: new option dwtp (disable-while-trackpointing) 2022-03-08 01:33:40 +00:00
contributing.rst doc/user: clarify fork visibility 2022-02-14 19:30:34 +01:00
dependencies.rst doc/user: generate the required package list for the CI distributions 2021-02-15 15:22:42 +10:00
development.rst High-resolution scroll wheel support 2021-08-31 08:45:01 +02:00
device-configuration-via-udev.rst doc/user: add an example udev rule for LIBINPUT_IGNORE_DEVICE 2021-11-16 06:47:48 +00:00
device-quirks.rst quirks: allow overriding of AttrEventCode and AttrInputProp 2022-11-28 08:25:41 +10:00
faqs.rst doc/user: write an article explaining the different contexts 2021-12-13 10:35:24 +10:00
features.rst treewide: fix typos 2020-12-16 22:08:23 +01:00
gestures.rst doc/user: move the hold gesture section up to the others 2021-07-27 05:20:45 +00:00
git_version.py.in doc/user: add a hack to get to the git version 2018-08-02 11:22:11 +10:00
incorrectly-enabled-hires.rst quirks: allow overriding of AttrEventCode and AttrInputProp 2022-11-28 08:25:41 +10:00
index.rst doc/user: expand the contributing document and make it top-level 2020-01-20 09:14:44 +10:00
meson.build doc/user: add a page to troubleshoot right-click Clickpads 2022-03-28 23:25:26 +00:00
middle-button-emulation.rst dox: switch to sphinx for the user-visible documentation 2018-07-30 12:24:04 +10:00
normalization-of-relative-motion.rst doc/user: explain why we are doing motion normalization 2021-03-16 21:29:56 +00:00
palm-detection.rst touchpad: new option dwtp (disable-while-trackpointing) 2022-03-08 01:33:40 +00:00
pointer-acceleration.rst doc/user: minor rewording of the pointer accel profile list 2022-07-15 10:47:13 +10:00
reporting-bugs.rst doc: correct the documentation for reporting trackpoint bugs 2022-02-11 07:45:40 +00:00
scrolling.rst High-resolution scroll wheel support 2021-08-31 08:45:01 +02:00
seats.rst dox: switch to sphinx for the user-visible documentation 2018-07-30 12:24:04 +10:00
switches.rst treewide: fix typos 2020-12-16 22:08:23 +01:00
t440-support.rst doc/user: more fixes including adding a device-types section 2018-08-02 11:22:11 +10:00
tablet-debugging.rst doc/user: fix broken link to systemd 60-evdev.hwdb 2021-10-30 12:10:10 +02:00
tablet-support.rst doc/user: move the tablet capabilities debugging to a separate page 2018-08-20 10:06:42 +10:00
tapping.rst doc: update the docs with a note regarding multifinger dragging 2021-02-15 17:13:46 +10:00
test-suite.rst meson: group all tests under suite names 2019-05-07 04:48:00 +00:00
timestamps.rst dox: switch to sphinx for the user-visible documentation 2018-07-30 12:24:04 +10:00
tools.rst AttrLidSwitchReliability quirk default unreliable->reliable 2022-04-26 01:55:22 +00:00
touchpad-jitter.rst doc/user: fix typo 2018-10-03 11:13:58 +10:00
touchpad-jumping-cursors.rst touchpad: ignore the ALPS jump to 4095/0 2020-09-07 02:13:40 +00:00
touchpad-pressure-debugging.rst tools: revamp the touchpad-pressure measuring tool 2020-03-30 14:44:47 +10:00
touchpad-pressure.rst doc/user: correct some small typos 2018-08-19 11:54:52 -05:00
touchpad-thumb-detection.rst doc/user: add documentation for the new thumb detection 2019-07-17 09:33:14 +10:00
touchpads.rst doc/user: mark the touchpads page as orphan 2018-08-03 11:18:14 +10:00
trackpoint-configuration.rst treewide: fix typos 2020-12-16 22:08:23 +01:00
trackpoints.rst doc/user: fix broken link to "Observations on trackpoint input data" 2021-11-28 13:49:14 +01:00
troubleshooting.rst doc/user: add a page to troubleshoot right-click Clickpads 2022-03-28 23:25:26 +00:00
what-is-libinput.rst doc/user: more fixes including adding a device-types section 2018-08-02 11:22:11 +10:00
wheel-api.rst High-resolution scroll wheel support 2021-08-31 08:45:01 +02:00