Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH] HID: magicmouse: add pressurepad property to Apple Magic Trackpad 2
@ 2026-10-01  0:06 Yicong Hui
  0 siblings, 0 replies; only message in thread
From: Yicong Hui @ 2026-10-01  0:06 UTC (permalink / raw)
  To: jikos, bentiss; +Cc: linux-input, linux-kernel, yiconghui, Yicong Hui

Userspace programs like libinput will take the pressure value reported
by trackpads, and use it as a proxy for contact size unless the
INPUT_PROP_PRESSUREPAD property is set, causing libinput to freeze the
touch input when pressing too hard.

Set the INPUT_PROP_PRESSUREPAD property for the Apple Magic Trackpad
2 indicating that it is a pressurepad reporting pressure measured
as a real force, as specified in commit ae8966b7b5bd ("Input: rename
INPUT_PROP_HAPTIC_TOUCHPAD to INPUT_PROP_PRESSUREPAD"), and set the
INPUT_MT_TOTAL_FORCE bit to allow reporting of the total force across
all contacts.

Signed-off-by: Yicong Hui <yicong@ycstuff.net>
---
 drivers/hid/hid-magicmouse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index d637c0477379..017e3805557f 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -620,10 +620,11 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd
 		__clear_bit(BTN_MIDDLE, input->keybit);
 		__set_bit(BTN_MOUSE, input->keybit);
 		__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
+		__set_bit(INPUT_PROP_PRESSUREPAD, input->propbit);
 		__set_bit(BTN_TOOL_FINGER, input->keybit);
 
 		mt_flags = INPUT_MT_POINTER | INPUT_MT_DROP_UNUSED |
-				INPUT_MT_TRACK;
+				INPUT_MT_TRACK | INPUT_MT_TOTAL_FORCE;
 	} else { /* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */
 		/* input->keybit is initialized with incorrect button info
 		 * for Magic Trackpad. There really is only one physical
-- 
2.55.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-01  0:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01  0:06 [PATCH] HID: magicmouse: add pressurepad property to Apple Magic Trackpad 2 Yicong Hui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox