Repository navigation
fix: ignore HID controllers with impossible readings - #115
Conversation
A Switch Pro Controller read through Windows' generic HID driver reports 6 to 10 buttons down at once and a D-pad stuck on Up with nobody touching it. The console interface trusted those readings, so it kept moving the focus and pressed "Play now" by itself, starting a session and switching the screens. ControllerMapping.UpdateHidTrust tracks each HID pad: a reading with more than 5 buttons down is skipped, and after 3 such readings in a row the pad is ignored until the app is reopened, with a line in the log. XInput pads do not go through this path and are not affected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Important
The filter can be bypassed by the same controller when Windows also exposes it through Gamepad.Gamepads.
Reviewed changes This review covers the HID invalid-reading threshold, per-pad distrust tracking, tests, and accompanying documentation.
- HID trust rule: Readings with more than five pressed buttons are skipped, and three consecutive such samples permanently distrust the device for the process.
- Coverage and documentation: Unit tests exercise the streak rule, and the changelogs and manual test checklist describe the new behavior.
GPT Luna | 𝕏
There was a problem hiding this comment.
Important
The WGI projection can still emit input during the two-sample grace period, so a defective controller may continue navigating or activating controls before it is distrusted.
Reviewed changes This review covers the changes since the prior Pullfrog review, which added filtering of invalid HID controllers from Windows.Gaming.Input.
- WGI projection filtering: Read raw HID controllers before WGI gamepads, then excluded projections corresponding to controllers already marked invalid.
GPT Luna | 𝕏

What
A Switch Pro Controller read through Windows' generic HID driver reports 6 to 10 buttons down and a stuck D-pad with nobody touching it. The console interface trusted that, kept moving the focus and pressed "Play now" by itself, starting a session.
ControllerMapping.UpdateHidTrusttracks each HID pad: a reading with more than 5 buttons down is skipped, and after 3 in a row the pad is ignored until the app is reopened, with a log line. XInput pads do not use this path.Verification
Built locally (0 errors);
dotnet testpasses (155, 4 new). The decision rule is unit tested; the real Switch Pro was not re-tested after the change. Manual check indocs/TESTING.md§3b.Stacked on #114.
🤖 Generated with Claude Code