From: Yicong Hui <yicong@ycstuff.net>
To: jikos@kernel.org, bentiss@kernel.org
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
yiconghui@gmail.com, Yicong Hui <yicong@ycstuff.net>
Subject: [PATCH] HID: magicmouse: add pressurepad property to Apple Magic Trackpad 2
Date: Thu, 1 Oct 2026 02:06:59 +0200 [thread overview]
Message-ID: <20261001000659.21747-1-yicong@ycstuff.net> (raw)
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
reply other threads:[~2026-10-01 0:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261001000659.21747-1-yicong@ycstuff.net \
--to=yicong@ycstuff.net \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yiconghui@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox