* [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads
@ 2025-12-21 23:43 Peter Hutterer via B4 Relay
2025-12-21 23:43 ` [PATCH v2 1/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type Peter Hutterer via B4 Relay
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Peter Hutterer via B4 Relay @ 2025-12-21 23:43 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Shuah Khan
Cc: Dmitry Torokhov, linux-input, linux-kselftest, linux-kernel,
Vadim Klishko, Peter Hutterer
Nicely enough MS defines a button type for a pressurepad touchpad [2]
and it looks like most touchpad vendors fill this in.
The selftests require a bit of prep work (and a hack for the test
itself) - hidtools 0.12 requires python-libevdev 0.13 which in turn
provides constructors for unknown properties.
[2] https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection#device-capabilities-feature-report
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
Changes in v2:
- rebased on top of 6.18
- hid-multitouch changes split out into a separate patch
- Patches reordered for slightly nicer history, tests changes are
grouped together
- Link to v1: https://lore.kernel.org/r/20251121-wip-hid-pressurepad-v1-0-e32e5565a527@who-t.net
---
Peter Hutterer (4):
HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type
selftests/hid: require hidtools 0.12
selftests/hid: use a enum class for the different button types
selftests/hid: add a test for the Digitizer/Button Type pressurepad
drivers/hid/hid-multitouch.c | 12 ++++-
tools/testing/selftests/hid/tests/conftest.py | 14 +++++
.../testing/selftests/hid/tests/test_multitouch.py | 61 +++++++++++++++++-----
3 files changed, 73 insertions(+), 14 deletions(-)
---
base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
change-id: 20251111-wip-hid-pressurepad-8a800cdf1813
Best regards,
--
Peter Hutterer <peter.hutterer@who-t.net>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type
2025-12-21 23:43 [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads Peter Hutterer via B4 Relay
@ 2025-12-21 23:43 ` Peter Hutterer via B4 Relay
2026-06-01 17:25 ` Rong Zhang
2025-12-21 23:43 ` [PATCH v2 2/4] selftests/hid: require hidtools 0.12 Peter Hutterer via B4 Relay
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Peter Hutterer via B4 Relay @ 2025-12-21 23:43 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Shuah Khan
Cc: Dmitry Torokhov, linux-input, linux-kselftest, linux-kernel,
Vadim Klishko, Peter Hutterer
From: Peter Hutterer <peter.hutterer@who-t.net>
A Digitizer/Button Type value of 1 indicates the device is a
pressurepad, see
https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection#device-capabilities-feature-report
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
drivers/hid/hid-multitouch.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 179dc316b4b518d78bdc900d9fd15756c5eba83e..382e6f50c4f7e663af7d028abb8be7cb2e6e7b8e 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -81,6 +81,7 @@ MODULE_LICENSE("GPL");
#define MT_INPUTMODE_TOUCHPAD 0x03
#define MT_BUTTONTYPE_CLICKPAD 0
+#define MT_BUTTONTYPE_PRESSUREPAD 1
enum latency_mode {
HID_LATENCY_NORMAL = 0,
@@ -179,6 +180,7 @@ struct mt_device {
__u8 inputmode_value; /* InputMode HID feature value */
__u8 maxcontacts;
bool is_buttonpad; /* is this device a button pad? */
+ bool is_pressurepad; /* is this device a pressurepad? */
bool is_haptic_touchpad; /* is this device a haptic touchpad? */
bool serial_maybe; /* need to check for serial protocol */
@@ -530,8 +532,14 @@ static void mt_feature_mapping(struct hid_device *hdev,
}
mt_get_feature(hdev, field->report);
- if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD)
+ switch (field->value[usage->usage_index]) {
+ case MT_BUTTONTYPE_CLICKPAD:
td->is_buttonpad = true;
+ break;
+ case MT_BUTTONTYPE_PRESSUREPAD:
+ td->is_pressurepad = true;
+ break;
+ }
break;
case 0xff0000c5:
@@ -1393,6 +1401,8 @@ static int mt_touch_input_configured(struct hid_device *hdev,
if (td->is_buttonpad)
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
+ if (td->is_pressurepad)
+ __set_bit(INPUT_PROP_PRESSUREPAD, input->propbit);
app->pending_palm_slots = devm_kcalloc(&hi->input->dev,
BITS_TO_LONGS(td->maxcontacts),
--
2.51.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/4] selftests/hid: require hidtools 0.12
2025-12-21 23:43 [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads Peter Hutterer via B4 Relay
2025-12-21 23:43 ` [PATCH v2 1/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type Peter Hutterer via B4 Relay
@ 2025-12-21 23:43 ` Peter Hutterer via B4 Relay
2025-12-21 23:43 ` [PATCH v2 3/4] selftests/hid: use a enum class for the different button types Peter Hutterer via B4 Relay
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Peter Hutterer via B4 Relay @ 2025-12-21 23:43 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Shuah Khan
Cc: Dmitry Torokhov, linux-input, linux-kselftest, linux-kernel,
Vadim Klishko, Peter Hutterer
From: Peter Hutterer <peter.hutterer@who-t.net>
Not all our tests really require it but since it's likely pip-installed
anyway it's trivial to require the new version, just in case we want to
start cleaning up other bits.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
tools/testing/selftests/hid/tests/conftest.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tools/testing/selftests/hid/tests/conftest.py b/tools/testing/selftests/hid/tests/conftest.py
index 1361ec981db6f79a58cf91e8732dcd7c05c47d38..985a535324b2fbe322e754e561d7af6898345b27 100644
--- a/tools/testing/selftests/hid/tests/conftest.py
+++ b/tools/testing/selftests/hid/tests/conftest.py
@@ -5,6 +5,7 @@
# Copyright (c) 2017 Benjamin Tissoires <benjamin.tissoires@gmail.com>
# Copyright (c) 2017 Red Hat, Inc.
+from packaging.version import Version
import platform
import pytest
import re
@@ -14,6 +15,19 @@ from .base import HIDTestUdevRule
from pathlib import Path
+@pytest.fixture(autouse=True)
+def hidtools_version_check():
+ HIDTOOLS_VERSION = "0.12"
+ try:
+ import hidtools
+
+ version = hidtools.__version__ # type: ignore
+ if Version(version) < Version(HIDTOOLS_VERSION):
+ pytest.skip(reason=f"have hidtools {version}, require >={HIDTOOLS_VERSION}")
+ except Exception:
+ pytest.skip(reason=f"hidtools >={HIDTOOLS_VERSION} required")
+
+
# See the comment in HIDTestUdevRule, this doesn't set up but it will clean
# up once the last test exited.
@pytest.fixture(autouse=True, scope="session")
--
2.51.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 3/4] selftests/hid: use a enum class for the different button types
2025-12-21 23:43 [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads Peter Hutterer via B4 Relay
2025-12-21 23:43 ` [PATCH v2 1/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type Peter Hutterer via B4 Relay
2025-12-21 23:43 ` [PATCH v2 2/4] selftests/hid: require hidtools 0.12 Peter Hutterer via B4 Relay
@ 2025-12-21 23:43 ` Peter Hutterer via B4 Relay
2025-12-22 7:36 ` Peter Hutterer
2025-12-21 23:43 ` [PATCH v2 4/4] selftests/hid: add a test for the Digitizer/Button Type pressurepad Peter Hutterer via B4 Relay
2026-01-07 15:13 ` [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads Benjamin Tissoires
4 siblings, 1 reply; 9+ messages in thread
From: Peter Hutterer via B4 Relay @ 2025-12-21 23:43 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Shuah Khan
Cc: Dmitry Torokhov, linux-input, linux-kselftest, linux-kernel,
Vadim Klishko, Peter Hutterer
From: Peter Hutterer <peter.hutterer@who-t.net>
Instead of multiple spellings of a string-provided argument, let's make
this a tad more type-safe and use an enum here.
And while we do this fix the two wrong devices:
- elan_04f3_313a (HP ZBook Fury 15) is discrete button pad
- dell_044e_1220 (Dell Precision 7740) is a discrete button pad
Equivalent hid-tools commit
https://gitlab.freedesktop.org/libevdev/hid-tools/-/commit/8300a55bf4213c6a252cab8cb5b34c9ddb191625
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
.../testing/selftests/hid/tests/test_multitouch.py | 24 +++++++++++++---------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/hid/tests/test_multitouch.py b/tools/testing/selftests/hid/tests/test_multitouch.py
index ece0ba8e7d34b75d42245e5936ecf804c46b0846..a06a087f00b6991f7514adf7f8c713bef1a43563 100644
--- a/tools/testing/selftests/hid/tests/test_multitouch.py
+++ b/tools/testing/selftests/hid/tests/test_multitouch.py
@@ -9,6 +9,7 @@
from . import base
from hidtools.hut import HUT
from hidtools.util import BusType
+import enum
import libevdev
import logging
import pytest
@@ -232,11 +233,17 @@ class Digitizer(base.UHIDTestDevice):
return 0
+class HIDButtonType(enum.IntEnum):
+ CLICKPAD = 0
+ PRESSUREPAD = 1
+ DISCRETE_BUTTONS = 2
+
+
class PTP(Digitizer):
def __init__(
self,
name,
- type="Click Pad",
+ buttontype=HIDButtonType.CLICKPAD,
rdesc_str=None,
rdesc=None,
application="Touch Pad",
@@ -244,11 +251,8 @@ class PTP(Digitizer):
max_contacts=None,
input_info=None,
):
- self.type = type.lower().replace(" ", "")
- if self.type == "clickpad":
- self.buttontype = 0
- else: # pressurepad
- self.buttontype = 1
+ self.buttontype = buttontype
+
self.clickpad_state = False
self.left_state = False
self.right_state = False
@@ -983,7 +987,7 @@ class BaseTest:
uhdev = self.uhdev
evdev = uhdev.get_evdev()
- if uhdev.type == "clickpad":
+ if uhdev.buttontype == HIDButtonType.CLICKPAD:
r = uhdev.event(click=True)
events = uhdev.next_sync_events()
self.debug_reports(r, uhdev, events)
@@ -1918,7 +1922,7 @@ class Testdell_044e_1220(BaseTest.TestPTP):
def create_device(self):
return PTP(
"uhid test dell_044e_1220",
- type="pressurepad",
+ buttontype=HIDButtonType.DISCRETE_BUTTONS,
rdesc="05 01 09 02 a1 01 85 01 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 75 01 95 03 81 02 95 05 81 01 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 09 38 95 01 81 06 05 0c 0a 38 02 81 06 c0 c0 05 0d 09 05 a1 01 85 08 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 af 04 75 10 55 0e 65 11 09 30 35 00 46 e8 03 95 01 81 02 26 7b 02 46 12 02 09 31 81 02 c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 05 0d 09 56 81 02 09 54 25 05 95 01 75 08 81 02 05 09 19 01 29 03 25 01 75 01 95 03 81 02 95 05 81 03 05 0d 85 09 09 55 75 08 95 01 25 05 b1 02 06 00 ff 85 0a 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 06 01 ff 09 01 a1 01 85 03 09 01 15 00 26 ff 00 95 1b 81 02 85 04 09 02 95 50 81 02 85 05 09 03 95 07 b1 02 85 06 09 04 81 02 c0 06 02 ff 09 01 a1 01 85 07 09 02 95 86 75 08 b1 02 c0 05 0d 09 0e a1 01 85 0b 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 0c 09 57 09 58 75 01 95
02 25 01 b1 02 95 06 b1 03 c0 c0",
)
@@ -2018,7 +2022,7 @@ class Testelan_04f3_313a(BaseTest.TestPTP):
def create_device(self):
return PTP(
"uhid test elan_04f3_313a",
- type="touchpad",
+ buttontype=HIDButtonType.DISCRETE_BUTTONS,
input_info=(BusType.I2C, 0x04F3, 0x313A),
rdesc="05 01 09 02 a1 01 85 01 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 75 01 95 03 81 02 95 05 81 03 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 75 08 95 05 81 03 c0 06 00 ff 09 01 85 0e 09 c5 15 00 26 ff 00 75 08 95 04 b1 02 85 0a 09 c6 15 00 26 ff 00 75 08 95 04 b1 02 c0 06 00 ff 09 01 a1 01 85 5c 09 01 95 0b 75 08 81 06 85 0d 09 c5 15 00 26 ff 00 75 08 95 04 b1 02 85 0c 09 c6 96 80 03 75 08 b1 02 85 0b 09 c7 95 82 75 08 b1 02 c0 05 0d 09 05 a1 01 85 04 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 05 09 09 02 09 03 15 00 25 01 75 01 95 02 81 02 05 0d 95 01 75 04 25 0f 09 51 81 02 05 01 15 00 26 d7 0e 75 10 55 0d 65 11 09 30 35 00 46 44 2f 95 01 81 02 46 12 16 26 eb 06 26 eb 06 09 31 81 02 05 0d 15 00 25 64 95 03 c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 09 56 81 02 09 54 25 7f 95 01 75 08 81 02 25 01 75 01 95 08 81 03 09 c5 75 08 95 02 81 03 05 0d 85 02 09 55 09 59 75 04 95 02 25 0f b1 02 85 07 09 60 75 01 95 01 15 00 25 01 b1 02 95 0f
b1 03 06 00 ff 06 00 ff 85 06 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 05 0d 09 0e a1 01 85 03 09 22 a1 00 09 52 15 00 25 0a 75 10 95 01 b1 02 c0 09 22 a1 00 85 05 09 57 09 58 75 01 95 02 25 01 b1 02 95 0e b1 03 c0 c0 05 01 09 02 a1 01 85 2a 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 75 01 95 03 81 02 95 05 81 03 05 01 09 30 09 31 15 81 25 7f 35 81 45 7f 55 00 65 13 75 08 95 02 81 06 75 08 95 05 81 03 c0 c0",
)
@@ -2110,7 +2114,7 @@ class Testsipodev_0603_0002(BaseTest.TestPTP):
def create_device(self):
return PTP(
"uhid test sipodev_0603_0002",
- type="clickpad",
+ buttontype=HIDButtonType.CLICKPAD,
rdesc="05 01 09 02 a1 01 85 03 09 01 a1 00 05 09 19 01 29 02 25 01 75 01 95 02 81 02 95 06 81 03 05 01 09 30 09 31 15 80 25 7f 75 08 95 02 81 06 c0 c0 05 0d 09 05 a1 01 85 04 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 75 01 95 02 81 03 95 01 75 04 25 05 09 51 81 02 05 01 15 00 26 44 0a 75 0c 55 0e 65 11 09 30 35 00 46 ac 03 95 01 81 02 46 fe 01 26 34 05 75 0c 09 31 81 02 05 0d c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 09 56 81 02 09 54 25 0a 95 01 75 04 81 02 75 01 95 03 81 03 05 09 09 01 25 01 75 01 95 01 81 02 05 0d 85 0a 09 55 09 59 75 04 95 02 25 0f b1 02 85 0b 09 60 75 01 95 01 15 00 25 01 b1 02 95 07 b1 03 85 09 06 00 ff 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 05 0d 09 0e a1 01 85 06 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 07 09 57 09 58 75 01 95 02 25 01 b1 02 95 06 b1 03 c0 c0 05 01 09 0c a1 01 85 08 15 00 25 01 09 c6 75 01 95 01 81 06 75 07 81 03 c0 05 01 09 80 a1 01 85 01 15 00 25 01 75 01 0a 81 00 0a
82 00 0a 83 00 95 03 81 06 95 05 81 01 c0 06 0c 00 09 01 a1 01 85 02 25 01 15 00 75 01 0a b5 00 0a b6 00 0a b7 00 0a cd 00 0a e2 00 0a a2 00 0a e9 00 0a ea 00 95 08 81 02 0a 83 01 0a 6f 00 0a 70 00 0a 88 01 0a 8a 01 0a 92 01 0a a8 02 0a 24 02 95 08 81 02 0a 21 02 0a 23 02 0a 96 01 0a 25 02 0a 26 02 0a 27 02 0a 23 02 0a b1 02 95 08 81 02 c0 06 00 ff 09 01 a1 01 85 05 15 00 26 ff 00 19 01 29 02 75 08 95 05 b1 02 c0",
)
--
2.51.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 4/4] selftests/hid: add a test for the Digitizer/Button Type pressurepad
2025-12-21 23:43 [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads Peter Hutterer via B4 Relay
` (2 preceding siblings ...)
2025-12-21 23:43 ` [PATCH v2 3/4] selftests/hid: use a enum class for the different button types Peter Hutterer via B4 Relay
@ 2025-12-21 23:43 ` Peter Hutterer via B4 Relay
2026-01-07 15:13 ` [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads Benjamin Tissoires
4 siblings, 0 replies; 9+ messages in thread
From: Peter Hutterer via B4 Relay @ 2025-12-21 23:43 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, Shuah Khan
Cc: Dmitry Torokhov, linux-input, linux-kselftest, linux-kernel,
Vadim Klishko, Peter Hutterer
From: Peter Hutterer <peter.hutterer@who-t.net>
We have to resort to a bit of a hack: python-libevdev gets the
properties from libevdev at module init time. If libevdev hasn't been
rebuilt with the new property it won't be automatically populated. So we
hack around this by constructing the property manually.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
.../testing/selftests/hid/tests/test_multitouch.py | 39 +++++++++++++++++++---
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/hid/tests/test_multitouch.py b/tools/testing/selftests/hid/tests/test_multitouch.py
index a06a087f00b6991f7514adf7f8c713bef1a43563..fa4fb2054bd4febb1d2497f2787944f538b27889 100644
--- a/tools/testing/selftests/hid/tests/test_multitouch.py
+++ b/tools/testing/selftests/hid/tests/test_multitouch.py
@@ -979,15 +979,36 @@ class BaseTest:
assert libevdev.InputEvent(libevdev.EV_ABS.ABS_MT_ORIENTATION, 90) in events
class TestPTP(TestWin8Multitouch):
+ def test_buttontype(self):
+ """Check for the right ButtonType."""
+ uhdev = self.uhdev
+ assert uhdev is not None
+ evdev = uhdev.get_evdev()
+
+ # If libevdev.so is not yet compiled with INPUT_PROP_PRESSUREPAD
+ # python-libevdev won't have it either, let's fake it
+ if not getattr(libevdev, "INPUT_PROP_PRESSUREPAD", None):
+ prop = libevdev.InputProperty(name="INPUT_PROP_PRESSUREPAD", value=0x7)
+ libevdev.INPUT_PROP_PRESSUREPAD = prop
+ libevdev.props.append(prop)
+
+ if uhdev.buttontype == HIDButtonType.CLICKPAD:
+ assert libevdev.INPUT_PROP_BUTTONPAD in evdev.properties
+ elif uhdev.buttontype == HIDButtonType.PRESSUREPAD:
+ assert libevdev.INPUT_PROP_PRESSUREPAD in evdev.properties
+ else:
+ assert libevdev.INPUT_PROP_PRESSUREPAD not in evdev.properties
+ assert libevdev.INPUT_PROP_BUTTONPAD not in evdev.properties
+
def test_ptp_buttons(self):
"""check for button reliability.
- There are 2 types of touchpads: the click pads and the pressure pads.
- Each should reliably report the BTN_LEFT events.
+ There are 3 types of touchpads: click pads + pressure pads and
+ those with discrete buttons. Each should reliably report the BTN_LEFT events.
"""
uhdev = self.uhdev
evdev = uhdev.get_evdev()
- if uhdev.buttontype == HIDButtonType.CLICKPAD:
+ if uhdev.buttontype in [HIDButtonType.CLICKPAD, HIDButtonType.PRESSUREPAD]:
r = uhdev.event(click=True)
events = uhdev.next_sync_events()
self.debug_reports(r, uhdev, events)
@@ -999,7 +1020,7 @@ class BaseTest:
self.debug_reports(r, uhdev, events)
assert libevdev.InputEvent(libevdev.EV_KEY.BTN_LEFT, 0) in events
assert evdev.value[libevdev.EV_KEY.BTN_LEFT] == 0
- else:
+ elif uhdev.buttontype == HIDButtonType.DISCRETE_BUTTONS:
r = uhdev.event(left=True)
events = uhdev.next_sync_events()
self.debug_reports(r, uhdev, events)
@@ -2062,6 +2083,16 @@ class Testite_06cb_2968(BaseTest.TestPTP):
)
+class Testven_0488_108c(BaseTest.TestPTP):
+ def create_device(self):
+ return PTP(
+ "uhid test ven_0488_108c",
+ rdesc="05 01 09 02 a1 01 85 06 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 01 75 05 81 03 05 01 09 30 09 31 09 38 15 81 25 7f 75 08 95 03 81 06 c0 c0 05 0d 09 05 a1 01 85 01 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 81 03 05 01 15 00 26 ba 0d 75 10 55 0e 65 11 09 30 35 00 46 d0 05 95 01 81 02 26 d0 06 46 bb 02 09 31 81 02 05 0d 95 01 75 10 26 ff 7f 46 ff 7f 09 30 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 81 03 05 01 15 00 26 ba 0d 75 10 55 0e 65 11 09 30 35 00 46 d0 05 95 01 81 02 26 d0 06 46 bb 02 09 31 81 02 05 0d 95 01 75 10 26 ff 7f 46 ff 7f 09 30 81 02 c0 05 0d 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 81 03 05 01 15 00 26 ba 0d 75 10 55 0e 65 11 09 30 35 00 46 d0 05 95 01 81 02 26 d0 06 46 bb 02 09 31 81 02 05 0d 95 01 75 10 26 ff 7f 46 ff 7f 09 30 81 02 c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00
75 10 95 01 05 0d 09 56 81 02 09 54 25 05 95 01 75 08 81 02 05 09 09 01 25 01 75 01 95 01 81 02 95 07 81 03 05 0d 85 02 09 55 75 08 95 01 25 05 b1 02 09 59 b1 02 06 00 ff 85 03 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 05 0e 09 01 a1 02 85 13 09 23 15 00 25 64 75 08 95 01 b1 02 c0 c0 05 0d 09 0e a1 01 85 04 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 05 09 57 09 58 75 01 95 02 25 01 b1 02 95 06 b1 03 c0 c0 06 01 ff 09 02 a1 01 09 00 85 07 15 00 26 ff 00 75 08 96 12 02 b1 02 c0 06 00 ff 09 01 a1 01 85 0d 15 00 26 ff 00 75 08 95 11 09 01 81 02 09 01 91 02 c0 05 0e 09 01 a1 01 85 11 09 35 15 00 26 ff 00 75 08 95 17 b1 02 c0 06 81 ff 09 01 a1 01 09 20 85 17 15 00 26 ff 00 75 08 95 3f 09 01 81 02 09 01 91 02 c0",
+ input_info=(0x18, 0x0488, 0x108C),
+ buttontype=HIDButtonType.PRESSUREPAD,
+ )
+
+
class Testn_trig_1b96_0c01(BaseTest.TestWin8Multitouch):
def create_device(self):
return Digitizer(
--
2.51.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 3/4] selftests/hid: use a enum class for the different button types
2025-12-21 23:43 ` [PATCH v2 3/4] selftests/hid: use a enum class for the different button types Peter Hutterer via B4 Relay
@ 2025-12-22 7:36 ` Peter Hutterer
0 siblings, 0 replies; 9+ messages in thread
From: Peter Hutterer @ 2025-12-22 7:36 UTC (permalink / raw)
To: Peter Hutterer via B4 Relay
Cc: Jiri Kosina, Benjamin Tissoires, Shuah Khan, Dmitry Torokhov,
linux-input, linux-kselftest, linux-kernel, Vadim Klishko
On Mon, Dec 22, 2025 at 09:43:36AM +1000, Peter Hutterer via B4 Relay wrote:
> From: Peter Hutterer <peter.hutterer@who-t.net>
>
> Instead of multiple spellings of a string-provided argument, let's make
> this a tad more type-safe and use an enum here.
>
> And while we do this fix the two wrong devices:
> - elan_04f3_313a (HP ZBook Fury 15) is discrete button pad
> - dell_044e_1220 (Dell Precision 7740) is a discrete button pad
>
> Equivalent hid-tools commit
> https://gitlab.freedesktop.org/libevdev/hid-tools/-/commit/8300a55bf4213c6a252cab8cb5b34c9ddb191625
>
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
looks like 3 and 4 from this series are still linewrapped because
the patches (thanks to the rdesc) exceed 998 characters. This happeed
with earlier patches but those got merged from a local repo by Benjamin
so no-one noticed. I've filed an MR in hid-tools to wrap them, we'll
need to sync these to the kernel tree before we can file patches via
email.
https://gitlab.freedesktop.org/libevdev/hid-tools/-/merge_requests/182
Cheers,
Peter
> ---
> .../testing/selftests/hid/tests/test_multitouch.py | 24 +++++++++++++---------
> 1 file changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/tools/testing/selftests/hid/tests/test_multitouch.py b/tools/testing/selftests/hid/tests/test_multitouch.py
> index ece0ba8e7d34b75d42245e5936ecf804c46b0846..a06a087f00b6991f7514adf7f8c713bef1a43563 100644
> --- a/tools/testing/selftests/hid/tests/test_multitouch.py
> +++ b/tools/testing/selftests/hid/tests/test_multitouch.py
> @@ -9,6 +9,7 @@
> from . import base
> from hidtools.hut import HUT
> from hidtools.util import BusType
> +import enum
> import libevdev
> import logging
> import pytest
> @@ -232,11 +233,17 @@ class Digitizer(base.UHIDTestDevice):
> return 0
>
>
> +class HIDButtonType(enum.IntEnum):
> + CLICKPAD = 0
> + PRESSUREPAD = 1
> + DISCRETE_BUTTONS = 2
> +
> +
> class PTP(Digitizer):
> def __init__(
> self,
> name,
> - type="Click Pad",
> + buttontype=HIDButtonType.CLICKPAD,
> rdesc_str=None,
> rdesc=None,
> application="Touch Pad",
> @@ -244,11 +251,8 @@ class PTP(Digitizer):
> max_contacts=None,
> input_info=None,
> ):
> - self.type = type.lower().replace(" ", "")
> - if self.type == "clickpad":
> - self.buttontype = 0
> - else: # pressurepad
> - self.buttontype = 1
> + self.buttontype = buttontype
> +
> self.clickpad_state = False
> self.left_state = False
> self.right_state = False
> @@ -983,7 +987,7 @@ class BaseTest:
> uhdev = self.uhdev
> evdev = uhdev.get_evdev()
>
> - if uhdev.type == "clickpad":
> + if uhdev.buttontype == HIDButtonType.CLICKPAD:
> r = uhdev.event(click=True)
> events = uhdev.next_sync_events()
> self.debug_reports(r, uhdev, events)
> @@ -1918,7 +1922,7 @@ class Testdell_044e_1220(BaseTest.TestPTP):
> def create_device(self):
> return PTP(
> "uhid test dell_044e_1220",
> - type="pressurepad",
> + buttontype=HIDButtonType.DISCRETE_BUTTONS,
> rdesc="05 01 09 02 a1 01 85 01 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 75 01 95 03 81 02 95 05 81 01 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 09 38 95 01 81 06 05 0c 0a 38 02 81 06 c0 c0 05 0d 09 05 a1 01 85 08 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 95 01 75 03 25 05 09 51 81 02 75 01 95 03 81 03 05 01 15 00 26 af 04 75 10 55 0e 65 11 09 30 35 00 46 e8 03 95 01 81 02 26 7b 02 46 12 02 09 31 81 02 c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 05 0d 09 56 81 02 09 54 25 05 95 01 75 08 81 02 05 09 19 01 29 03 25 01 75 01 95 03 81 02 95 05 81 03 05 0d 85 09 09 55 75 08 95 01 25 05 b1 02 06 00 ff 85 0a 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 06 01 ff 09 01 a1 01 85 03 09 01 15 00 26 ff 00 95 1b 81 02 85 04 09 02 95 50 81 02 85 05 09 03 95 07 b1 02 85 06 09 04 81 02 c0 06 02 ff 09 01 a1 01 85 07 09 02 95 86 75 08 b1 02 c0 05 0d 09 0e a1 01 85 0b 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 0c 09 57 09 58 75 01 95
> 02 25 01 b1 02 95 06 b1 03 c0 c0",
> )
>
> @@ -2018,7 +2022,7 @@ class Testelan_04f3_313a(BaseTest.TestPTP):
> def create_device(self):
> return PTP(
> "uhid test elan_04f3_313a",
> - type="touchpad",
> + buttontype=HIDButtonType.DISCRETE_BUTTONS,
> input_info=(BusType.I2C, 0x04F3, 0x313A),
> rdesc="05 01 09 02 a1 01 85 01 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 75 01 95 03 81 02 95 05 81 03 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 75 08 95 05 81 03 c0 06 00 ff 09 01 85 0e 09 c5 15 00 26 ff 00 75 08 95 04 b1 02 85 0a 09 c6 15 00 26 ff 00 75 08 95 04 b1 02 c0 06 00 ff 09 01 a1 01 85 5c 09 01 95 0b 75 08 81 06 85 0d 09 c5 15 00 26 ff 00 75 08 95 04 b1 02 85 0c 09 c6 96 80 03 75 08 b1 02 85 0b 09 c7 95 82 75 08 b1 02 c0 05 0d 09 05 a1 01 85 04 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 05 09 09 02 09 03 15 00 25 01 75 01 95 02 81 02 05 0d 95 01 75 04 25 0f 09 51 81 02 05 01 15 00 26 d7 0e 75 10 55 0d 65 11 09 30 35 00 46 44 2f 95 01 81 02 46 12 16 26 eb 06 26 eb 06 09 31 81 02 05 0d 15 00 25 64 95 03 c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 09 56 81 02 09 54 25 7f 95 01 75 08 81 02 25 01 75 01 95 08 81 03 09 c5 75 08 95 02 81 03 05 0d 85 02 09 55 09 59 75 04 95 02 25 0f b1 02 85 07 09 60 75 01 95 01 15 00 25 01 b1 02 95 0f
> b1 03 06 00 ff 06 00 ff 85 06 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 05 0d 09 0e a1 01 85 03 09 22 a1 00 09 52 15 00 25 0a 75 10 95 01 b1 02 c0 09 22 a1 00 85 05 09 57 09 58 75 01 95 02 25 01 b1 02 95 0e b1 03 c0 c0 05 01 09 02 a1 01 85 2a 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 75 01 95 03 81 02 95 05 81 03 05 01 09 30 09 31 15 81 25 7f 35 81 45 7f 55 00 65 13 75 08 95 02 81 06 75 08 95 05 81 03 c0 c0",
> )
> @@ -2110,7 +2114,7 @@ class Testsipodev_0603_0002(BaseTest.TestPTP):
> def create_device(self):
> return PTP(
> "uhid test sipodev_0603_0002",
> - type="clickpad",
> + buttontype=HIDButtonType.CLICKPAD,
> rdesc="05 01 09 02 a1 01 85 03 09 01 a1 00 05 09 19 01 29 02 25 01 75 01 95 02 81 02 95 06 81 03 05 01 09 30 09 31 15 80 25 7f 75 08 95 02 81 06 c0 c0 05 0d 09 05 a1 01 85 04 09 22 a1 02 15 00 25 01 09 47 09 42 95 02 75 01 81 02 75 01 95 02 81 03 95 01 75 04 25 05 09 51 81 02 05 01 15 00 26 44 0a 75 0c 55 0e 65 11 09 30 35 00 46 ac 03 95 01 81 02 46 fe 01 26 34 05 75 0c 09 31 81 02 05 0d c0 55 0c 66 01 10 47 ff ff 00 00 27 ff ff 00 00 75 10 95 01 09 56 81 02 09 54 25 0a 95 01 75 04 81 02 75 01 95 03 81 03 05 09 09 01 25 01 75 01 95 01 81 02 05 0d 85 0a 09 55 09 59 75 04 95 02 25 0f b1 02 85 0b 09 60 75 01 95 01 15 00 25 01 b1 02 95 07 b1 03 85 09 06 00 ff 09 c5 15 00 26 ff 00 75 08 96 00 01 b1 02 c0 05 0d 09 0e a1 01 85 06 09 22 a1 02 09 52 15 00 25 0a 75 08 95 01 b1 02 c0 09 22 a1 00 85 07 09 57 09 58 75 01 95 02 25 01 b1 02 95 06 b1 03 c0 c0 05 01 09 0c a1 01 85 08 15 00 25 01 09 c6 75 01 95 01 81 06 75 07 81 03 c0 05 01 09 80 a1 01 85 01 15 00 25 01 75 01 0a 81 00 0a
> 82 00 0a 83 00 95 03 81 06 95 05 81 01 c0 06 0c 00 09 01 a1 01 85 02 25 01 15 00 75 01 0a b5 00 0a b6 00 0a b7 00 0a cd 00 0a e2 00 0a a2 00 0a e9 00 0a ea 00 95 08 81 02 0a 83 01 0a 6f 00 0a 70 00 0a 88 01 0a 8a 01 0a 92 01 0a a8 02 0a 24 02 95 08 81 02 0a 21 02 0a 23 02 0a 96 01 0a 25 02 0a 26 02 0a 27 02 0a 23 02 0a b1 02 95 08 81 02 c0 06 00 ff 09 01 a1 01 85 05 15 00 26 ff 00 19 01 29 02 75 08 95 05 b1 02 c0",
> )
>
>
> --
> 2.51.1
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads
2025-12-21 23:43 [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads Peter Hutterer via B4 Relay
` (3 preceding siblings ...)
2025-12-21 23:43 ` [PATCH v2 4/4] selftests/hid: add a test for the Digitizer/Button Type pressurepad Peter Hutterer via B4 Relay
@ 2026-01-07 15:13 ` Benjamin Tissoires
4 siblings, 0 replies; 9+ messages in thread
From: Benjamin Tissoires @ 2026-01-07 15:13 UTC (permalink / raw)
To: Jiri Kosina, Shuah Khan, Peter Hutterer
Cc: Dmitry Torokhov, linux-input, linux-kselftest, linux-kernel,
Vadim Klishko
On Mon, 22 Dec 2025 09:43:33 +1000, Peter Hutterer wrote:
> Nicely enough MS defines a button type for a pressurepad touchpad [2]
> and it looks like most touchpad vendors fill this in.
>
> The selftests require a bit of prep work (and a hack for the test
> itself) - hidtools 0.12 requires python-libevdev 0.13 which in turn
> provides constructors for unknown properties.
>
> [...]
Applied to hid/hid.git (for-6.19/upstream-fixes), thanks!
[1/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type
https://git.kernel.org/hid/hid/c/2b29a90131bb
[2/4] selftests/hid: require hidtools 0.12
https://git.kernel.org/hid/hid/c/1d6628f7f279
[3/4] selftests/hid: use a enum class for the different button types
https://git.kernel.org/hid/hid/c/4f36fdab084f
[4/4] selftests/hid: add a test for the Digitizer/Button Type pressurepad
https://git.kernel.org/hid/hid/c/f287ba5951a4
Cheers,
--
Benjamin Tissoires <bentiss@kernel.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type
2025-12-21 23:43 ` [PATCH v2 1/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type Peter Hutterer via B4 Relay
@ 2026-06-01 17:25 ` Rong Zhang
2026-06-16 4:24 ` Peter Hutterer
0 siblings, 1 reply; 9+ messages in thread
From: Rong Zhang @ 2026-06-01 17:25 UTC (permalink / raw)
To: devnull+peter.hutterer.who-t.net
Cc: bentiss, dmitry.torokhov, jikos, linux-input, linux-kernel,
linux-kselftest, peter.hutterer, shuah, vadim
Hi all,
Hopefully I'm not too late to show up here.
> From: Peter Hutterer <peter.hutterer@who-t.net>
>
> A Digitizer/Button Type value of 1 indicates the device is a
> pressurepad, see
> https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection#device-capabilities-feature-report
>
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> ---
> drivers/hid/hid-multitouch.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> index 179dc316b4b518d78bdc900d9fd15756c5eba83e..382e6f50c4f7e663af7d028abb8be7cb2e6e7b8e 100644
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -81,6 +81,7 @@ MODULE_LICENSE("GPL");
> #define MT_INPUTMODE_TOUCHPAD 0x03
>
> #define MT_BUTTONTYPE_CLICKPAD 0
> +#define MT_BUTTONTYPE_PRESSUREPAD 1
>
> enum latency_mode {
> HID_LATENCY_NORMAL = 0,
> @@ -179,6 +180,7 @@ struct mt_device {
> __u8 inputmode_value; /* InputMode HID feature value */
> __u8 maxcontacts;
> bool is_buttonpad; /* is this device a button pad? */
> + bool is_pressurepad; /* is this device a pressurepad? */
> bool is_haptic_touchpad; /* is this device a haptic touchpad? */
> bool serial_maybe; /* need to check for serial protocol */
>
> @@ -530,8 +532,14 @@ static void mt_feature_mapping(struct hid_device *hdev,
> }
>
> mt_get_feature(hdev, field->report);
> - if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD)
> + switch (field->value[usage->usage_index]) {
> + case MT_BUTTONTYPE_CLICKPAD:
> td->is_buttonpad = true;
> + break;
> + case MT_BUTTONTYPE_PRESSUREPAD:
> + td->is_pressurepad = true;
> + break;
> + }
>
> break;
> case 0xff0000c5:
> @@ -1393,6 +1401,8 @@ static int mt_touch_input_configured(struct hid_device *hdev,
>
> if (td->is_buttonpad)
> __set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
> + if (td->is_pressurepad)
> + __set_bit(INPUT_PROP_PRESSUREPAD, input->propbit);
I noticed that this leads to dual reporting on my device.
Consider previous checks:
if (application == HID_DG_TOUCHPAD) {
mt_application->mt_flags |= INPUT_MT_POINTER;
td->inputmode_value = MT_INPUTMODE_TOUCHPAD;
}
...
/* check for clickpads */
if ((app->mt_flags & INPUT_MT_POINTER) &&
(app->buttons_count == 1))
td->is_buttonpad = true;
... where `td->is_buttonpad' is set to true when a pressure pad has only
one button, i.e., the "touchpad button integrated with digitizer" [1].
Most (if not all) pressure pads fall into this category. As a result,
the presence of INPUT_PROP_PRESSUREPAD is always accompanied by the
presence of INPUT_PROP_BUTTONPAD.
Since the corresponding testcase neither expects dual reporting nor
prohibits it, I am confused of the intended properties to expose. Is it
a mistake or an intended behavior? If it's the former, I am going to
submit a patch to fix it.
[1]: https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-buttons-report-level-usages
Thanks,
Rong
>
> app->pending_palm_slots = devm_kcalloc(&hi->input->dev,
> BITS_TO_LONGS(td->maxcontacts),
>
> --
> 2.51.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type
2026-06-01 17:25 ` Rong Zhang
@ 2026-06-16 4:24 ` Peter Hutterer
0 siblings, 0 replies; 9+ messages in thread
From: Peter Hutterer @ 2026-06-16 4:24 UTC (permalink / raw)
To: Rong Zhang
Cc: devnull+peter.hutterer.who-t.net, bentiss, dmitry.torokhov, jikos,
linux-input, linux-kernel, linux-kselftest, shuah, vadim
Hi Rong,
On Tue, Jun 02, 2026 at 01:25:57AM +0800, Rong Zhang wrote:
>
> Hi all,
>
> Hopefully I'm not too late to show up here.
>
> > From: Peter Hutterer <peter.hutterer@who-t.net>
> >
> > A Digitizer/Button Type value of 1 indicates the device is a
> > pressurepad, see
> > https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection#device-capabilities-feature-report
> >
> > Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> > ---
> > drivers/hid/hid-multitouch.c | 12 +++++++++++-
> > 1 file changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> > index 179dc316b4b518d78bdc900d9fd15756c5eba83e..382e6f50c4f7e663af7d028abb8be7cb2e6e7b8e 100644
> > --- a/drivers/hid/hid-multitouch.c
> > +++ b/drivers/hid/hid-multitouch.c
> > @@ -81,6 +81,7 @@ MODULE_LICENSE("GPL");
> > #define MT_INPUTMODE_TOUCHPAD 0x03
> >
> > #define MT_BUTTONTYPE_CLICKPAD 0
> > +#define MT_BUTTONTYPE_PRESSUREPAD 1
> >
> > enum latency_mode {
> > HID_LATENCY_NORMAL = 0,
> > @@ -179,6 +180,7 @@ struct mt_device {
> > __u8 inputmode_value; /* InputMode HID feature value */
> > __u8 maxcontacts;
> > bool is_buttonpad; /* is this device a button pad? */
> > + bool is_pressurepad; /* is this device a pressurepad? */
> > bool is_haptic_touchpad; /* is this device a haptic touchpad? */
> > bool serial_maybe; /* need to check for serial protocol */
> >
> > @@ -530,8 +532,14 @@ static void mt_feature_mapping(struct hid_device *hdev,
> > }
> >
> > mt_get_feature(hdev, field->report);
> > - if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD)
> > + switch (field->value[usage->usage_index]) {
> > + case MT_BUTTONTYPE_CLICKPAD:
> > td->is_buttonpad = true;
> > + break;
> > + case MT_BUTTONTYPE_PRESSUREPAD:
> > + td->is_pressurepad = true;
> > + break;
> > + }
> >
> > break;
> > case 0xff0000c5:
> > @@ -1393,6 +1401,8 @@ static int mt_touch_input_configured(struct hid_device *hdev,
> >
> > if (td->is_buttonpad)
> > __set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
> > + if (td->is_pressurepad)
> > + __set_bit(INPUT_PROP_PRESSUREPAD, input->propbit);
>
> I noticed that this leads to dual reporting on my device.
>
> Consider previous checks:
>
> if (application == HID_DG_TOUCHPAD) {
> mt_application->mt_flags |= INPUT_MT_POINTER;
> td->inputmode_value = MT_INPUTMODE_TOUCHPAD;
> }
>
> ...
>
> /* check for clickpads */
> if ((app->mt_flags & INPUT_MT_POINTER) &&
> (app->buttons_count == 1))
> td->is_buttonpad = true;
>
> ... where `td->is_buttonpad' is set to true when a pressure pad has only
> one button, i.e., the "touchpad button integrated with digitizer" [1].
> Most (if not all) pressure pads fall into this category. As a result,
> the presence of INPUT_PROP_PRESSUREPAD is always accompanied by the
> presence of INPUT_PROP_BUTTONPAD.
Yes, this is intended, see commit
ae8966b7b5bd69b86209cc34bcca1ba9f18b68e6 which lists this in the commit
message:
```
This means:
- clickpad: INPUT_PROP_BUTTONPAD
- pressurepad: INPUT_PROP_BUTTONPAD + INPUT_PROP_PRESSUREPAD
- pressurepad with configurable haptics:
INPUT_PROP_BUTTONPAD + INPUT_PROP_PRESSUREPAD + FF_HAPTIC
```
We have to keep setting BUTTONPAD on all pressurepads because otherwise
we'd break existing userspace which relies on this.
Cheers,
Peter
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-06-16 4:24 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-21 23:43 [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads Peter Hutterer via B4 Relay
2025-12-21 23:43 ` [PATCH v2 1/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type Peter Hutterer via B4 Relay
2026-06-01 17:25 ` Rong Zhang
2026-06-16 4:24 ` Peter Hutterer
2025-12-21 23:43 ` [PATCH v2 2/4] selftests/hid: require hidtools 0.12 Peter Hutterer via B4 Relay
2025-12-21 23:43 ` [PATCH v2 3/4] selftests/hid: use a enum class for the different button types Peter Hutterer via B4 Relay
2025-12-22 7:36 ` Peter Hutterer
2025-12-21 23:43 ` [PATCH v2 4/4] selftests/hid: add a test for the Digitizer/Button Type pressurepad Peter Hutterer via B4 Relay
2026-01-07 15:13 ` [PATCH v2 0/4] HID: multitouch: set INPUT_PROP_PRESSUREPAD on compatible touchpads Benjamin Tissoires
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox