Repository navigation
Conversation
Precision Touchpads may pack several contacts into one HID report, each in its own link collection. The parser only read link collection 1, so a frame with N fingers never collected N contacts and multi-finger gestures never fired. Discover the finger collections from the X value caps and read each slot up to the report's contact count. Pads that send one finger per report behave as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vqgg7FJDUhFB9QhMgod1Ht
|
hey. thanks for the PR. for some reason this project has gotten several stars without any promotion and i did not receive any notification about it. |
|
GPT (or Claude, i dont remember) told me about that project. Nice work, hope u keep improving it ❤️ |
|
Appreciate it and yes, seems like I'm gonna be maintaining it along side wisp, which is my other popular system utility. |
|
The link is wrong. I was scratching my head trying to figure out what the connection was 😄 Do you mean this one https://github.com/SumirSeth/wisp and not that one https://github.com/wisp, right? |
Ah yes! Problems of being on a phone :p |
Problem
On my laptop only one-finger gestures (edges, corners) worked. 3-, 4- and 5-finger swipes, taps, twists and pinches never fired.
The touchpad sends every finger in a single HID report: one report has five link collections (L1–L5) and the contact count says how many of them are in use.
Device::reportonly ever read link collection 1. A frame with N fingers therefore never collected N contacts,pendingwas reset by the next report, and the recognizer only ever saw one-finger frames.Fix
HidP_GetSpecificValueCapswithLinkCollection = 0). Each of them is one finger slot.report, read the slots in order until the frame's contact count is reached. Slots past the count are padding and are skipped.Touchpads that send one finger per report have a single slot (
[1]), so they make exactly the same HID calls as before.What changed and where
Two files, +50 / −16. Only HID report parsing changed. The gesture recognizers, config and UI are untouched.
crates/engine/src/platform.rs, all insidestruct Device:struct Devicefingers: Vec<u16>: the link collections that hold one finger each, in descriptor order.Device::loadfingersfrom the X value caps (duplicates removed). Width/height and scale are computed from the first X and Y caps.Device::value_caps(new)HIDP_CAPS::NumberInputValueCaps.Device::axis&HIDP_VALUE_CAPSinstead of looking it up in link collection 1. The unit and extent maths is unchanged.Device::reportfingers. The loop stops oncependingreaches the contact count. Lifted contacts (no tip switch) are still counted and then dropped, as before.CHANGELOG.md: anUnreleased → Fixedentry.Testing
Hardware
ACPI\ASUP1415), 127 × 71 mm, 5 finger slots in report ID 84Results
n=3with three distinct contacts. Before the fix they never got past one contact.Checks
cargo fmt --checkpasses.cargo test --workspacepasses.cargo clippy -p gestures_engine -- -D warningspasses. For the workspace-wide clippy run, see the CI note below.gestures.rsdidn't change, andDeviceparses live HID reports through the Windows HID API, so the existing tests can't exercise it without hardware.CI note: an existing clippy failure, not caused by this PR
cargo clippy --workspace --locked -- -D warnings(the second CI step) fails on currentmainwith the latest stable Rust (1.100):The
needless_range_looplint now reports this loop inapp/src/ui.rs(the settings window), which this PR doesn't touch. Because that step fails, CI skipscargo testandcargo buildas well. I left it out to keep this PR focused, and I'm happy to add the fix here or open a separate PR, whichever you prefer.Investigated and fixed together with Claude Code (Opus 5.5)