diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2017-06-28 13:09:22 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2017-07-03 15:58:13 +1000 |
commit | 25d54b90db6ac056157a7ad5c807c70b43b23c9b (patch) | |
tree | 3367c9d0a11f9bf32deb20f5dd5b713e1290fc8e /udev | |
parent | 381cce8ddd07e69bdd68159bd11bd6efef5214a0 (diff) | |
download | libinput-25d54b90db6ac056157a7ad5c807c70b43b23c9b.tar.gz |
touchpad: add pressure-base palm detection
If a touch goes past the fixed pressure threshold it is labelled as a palm and
stays a palm. Default value is one that works well here on a T440 and is
virtually impossible to trigger by a normal finger or thumb. A udev property
is exposed so we can handle this in the udev hwdb and the new tool introduce a
few commits ago can help finding the palm detection threshold.
Unlike the other palm detection features, once a palm goes past the threshold
it remains a palm until the touch is released. This means palm overrides any
other palm detection features. For code simplicity, we don't combine the
states but merely check for pressure before and after the other palm detection
functions. If the pressure triggers, it will trigger before anything else. And
if something else is already active (e.g. edge where the pressure doesn't work
well) it will trigger as soon as the palm is released.
The palm threshold should thus be chosen with some room to spare between the
highest finger pressure.
https://bugs.freedesktop.org/show_bug.cgi?id=94236
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'udev')
-rw-r--r-- | udev/90-libinput-model-quirks.hwdb | 1 | ||||
-rwxr-xr-x | udev/parse_hwdb.py | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb index f9e7093a..89e95723 100644 --- a/udev/90-libinput-model-quirks.hwdb +++ b/udev/90-libinput-model-quirks.hwdb @@ -183,6 +183,7 @@ libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPad??50*: libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPad??60*: libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPadX1Carbon3rd:* LIBINPUT_MODEL_LENOVO_T450_TOUCHPAD=1 + LIBINPUT_ATTR_PALM_PRESSURE_THRESHOLD=150 ########################################## # Logitech diff --git a/udev/parse_hwdb.py b/udev/parse_hwdb.py index 8ac64010..5b7b4538 100755 --- a/udev/parse_hwdb.py +++ b/udev/parse_hwdb.py @@ -122,8 +122,12 @@ def property_grammar(): Suppress('=') - kbintegration_tags('VALUE')] + palm_prop = [Literal('LIBINPUT_ATTR_PALM_PRESSURE_THRESHOLD')('NAME') - + Suppress('=') - + INTEGER('X')] + grammar = Or(model_props + size_props + reliability + tpkbcombo + - pressure_prop + kbintegration) + pressure_prop + kbintegration + palm_prop) return grammar |