Repository navigation
feat: other brands' centre button opens Console Mode, through standard HID usages - #226
Merged
Merged
Conversation
…d HID usages XInput never reports the centre button of pads that aren't Xbox, even when it covers the rest of the pad (an Amazon Luna over Bluetooth, issue #217). HidHomeButtonReader looks, on every collection of a game controller's vendor and product (not Microsoft, not Sony), for the standard usages of that button: Generic Desktop System Main Menu (0x85) and Consumer AC Home (0x223). Collections that declare one are opened shared and read; the button counts as Guide for the controller shortcuts and for recording a new one. Keyboards that declare AC Home are never read: only devices that are also game controllers. HidDevices gains OpenForRead, DeclaredButtons and PressedButtons (HidP_GetSpecificButtonCaps, HidP_GetUsagesEx). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound — discovers non-Xbox/non-PlayStation gamepad collections and reads the standard HID home usages without exclusive access, then maps them to the existing Guide shortcut.
Reviewed changes This review covers the HID reader, shortcut capture and hold-watcher integration, mapping rules and tests, plus the changelog and manual test checklist.
- HID discovery and parsing: Identifies controller collections by VID/PID, finds collections declaring the standard home usages, and tracks their input reports.
- Shortcut integration: Acquires/releases the reader alongside shortcut watching and capture, exposing the held home button as Guide.
- Rules and verification: Adds pure usage mapping tests and manual checks for supported controllers and existing Xbox/PlayStation behavior.
gpt-6-luna | 𝕏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Second of three PRs for generic controllers in 1.7.1-beta.4. Stacked on #225 (shares
Native/HidDevices): merge #225 first, then retarget this tomain.What
PLEXX-DE (#217): the centre button of an Amazon Luna pad (Bluetooth,
0171:0419) doesn't open Console Mode; only Select + Y works. XInput (XInputGetStateEx) reports the Guide button for Xbox pads only, even when it covers the rest of another brand's pad.Rather than a per-model rule, this reads the standard HID usages of a controller's centre button, for any brand:
0x01:0x85)0x0C:0x223)HidHomeButtonReader(new, started with the controller shortcuts and while recording one):SonyHidReaderreads PS). All collections of that vendor+product are looked at, since the button may sit on a sibling "consumer control" collection;HidP_GetSpecificButtonCaps) is opened shared and read (HidP_GetUsagesEx); the button sets Guide (0x0400) for that device; a report of another id keeps the last state;lendo o botão central pelo HID (<vid:pid>, <usage>), or that Windows won't let it be read.ControllerHoldWatcherandShortcutPickertake it like the Sony reader: Guide alone is matched per device; Guide plus another button on such a pad isn't (its other buttons come through XInput).Pure rules in
ControllerMapping(tested):HomeUsages,IsHomeUsage,ReadsHomeFromHid,DescribeUsage(also for the diagnostics PR).Changelogs (both) and
docs/TESTING.mdupdated.Testing
dotnet test: 715 passing (15 new). Debug build OK; 20 s run with no error in the log.HidDevices.cs:DeclaredButtonsfound exactly what each collection declares (the keyboard's and the receiver's consumer collections declare AC Home, which is why only devices that are game controllers are looked at); consumer collections open for reading, keyboards and mice don't;PressedButtonsparses reports and returns null for other report ids.🤖 Generated with Claude Code