Skip to contentSkip to conversation

HID: magicmouse: add pressurepad property to Apple Magic Trackpad 2

PATCH In review Yicong Hui 1 participant 2 messages Oct 1 – Nov 2 HID

lore
Share & tools
lore

Yicong Hui

author
#0 lore raw

PATCH 1/1 HID: magicmouse: add pressurepad property to Apple Magic Trackpad 2

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.

---
 drivers/hid/hid-magicmouse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hid/hid-magicmouse.c +2 -1
index d637c0477379..017e3805557f 100644
@@ -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
Signature · 1 line
2.55.0
author
#1 lore raw
Quoted 35 lines · 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.

---
 drivers/hid/hid-magicmouse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hid/hid-magicmouse.c +2 -2
index d637c0477379..017e3805557f 100644
@@ -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
--
Quoted 3 lines

2.55.0

Hi! Is there any progress or feedback on this patch?

Thanks!