Skip to content

ipts: Handle the button report of force touchpads - #237

Open
fidecastro wants to merge 1 commit into
linux-surface:masterfrom
fidecastro:force-button
Open

fidecastro wants to merge 1 commit into
linux-surface:masterfrom
fidecastro:force-button

Conversation

@fidecastro

Copy link
Copy Markdown

Pressing the touchpad does nothing under iptsd on the Surface Laptop 7 15" (Snapdragon, HID 045E:0C77): taps work, a press does not, so there is no press-and-drag and no two-finger press for a right click. This makes the press work.

Cause. The pad has no moving parts. It measures force and decides by itself when that is a click. It never sends the button report (0x90). Every HID report (id 0x0a) carries, after the heatmap, report frames of types 0x00 0x03 0x0b 0x04 0x07 0x32 0x94 0x96 0xff, and the button is in 0x96, 48 bytes:

Offset Type What I saw
0 u16 Force. 0 untouched, up to about 60 in a tap, 200 to 800 in a press
2 u16 Always 0x8003
4 6 × f32 Rise with the force; my guess is the individual sensors
28 u8 1 while any force is measured
29 u8 Button. Turns 1 above the press threshold, 0 below the release threshold
30 u16 Force again, within 1 of offset 0
32, 34 u16 150 and 95: press and release thresholds. Read 32767 and 0 for two frames while a second finger lands
36, 37 u8 Finger counts, 0 to 2
38 10 bytes Always 0

Only the force and the button byte are used. The rest is described as I understand it and marked reserved where I don't.

Change. A ForceButton = 0x96 report type, a ForceSample struct, and parse_force_button, which feeds the existing on_button. A report of any other size is ignored. Nothing changes for devices that send 0x90.

Tested on that laptop with this patch on v3.1.0: press to click, press and drag, and two-finger press for a right click work; a tap is still a tap and does not register as a press. Built on current master with -Dwerror=true as well. In a 20 second capture of one tap and six presses, the button byte was 0 through the tap and 1 through each press.

Not tested: any other device. #192 describes the same symptom on the Intel Surface Laptop 7, whose touchpad is also a haptic one; if it sends 0x96 too, this may fix it, but I have no way to check. A capture from that machine would tell.

Prepared with Claude Fable 5.2.

The touchpad of the Surface Laptop 7 15" (045E:0C77) has no moving parts.
It measures force and decides by itself when that amounts to a click, with
a higher threshold for pressing than for releasing. It does not send the
button report (0x90). Instead, every heatmap comes with a report of type
0x96 that carries the force and the state of the button, so pressing the
touchpad did nothing while iptsd was running.

Parse that report and pass it on as a button sample.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant