summaryrefslogtreecommitdiffstats
path: root/tools/analyze-dump-sort.py
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2022-04-08 08:21:47 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-04-12 09:24:25 +0200
commitbc85f8b51d962597360e982811e674c126850f56 (patch)
treef3933cb88009ea12e69f94a1afe12ab2c248d7da /tools/analyze-dump-sort.py
parentMerge pull request #23051 from poettering/udev-tweaklets-2 (diff)
downloadsystemd-bc85f8b51d962597360e982811e674c126850f56.tar.xz
systemd-bc85f8b51d962597360e982811e674c126850f56.zip
udev-builtin-input_id: use heuristics to detect joysticks
Several keyboard devices are erroneously tagged with ID_INPUT_JOYSTICK because of random buttons they set. For example, the LiteOn Lenovo Calliope USB Keyboard sets BTN_TRIGGER, BTN_TOP2, BTN_PINKIE and BTN_BASE, see libinput issue 745 for details. ID_INPUT_JOYSTICK triggers the uaccess rules, making those keyboards easily accessible. That's not a problem in the LiteOn example since that event node doesn't contain the normal keys and eavesdropping on volume keys is probably not very interesting. Improve the joystick detection by adding heuristics similar to what libinput 1.20 uses: check for some specific set of keys that are common on keyboards but very unlikely on joysticks. If enough of those are present (or the device has less than 2 axes or joysticks), don't tag it as joystick. libinput also checks for > 10 keyboard keys, but this is not done here to be more conservative.
Diffstat (limited to 'tools/analyze-dump-sort.py')
0 files changed, 0 insertions, 0 deletions