fix: decode the Guide button bit in decodeXInput360 (XInput-360 family) - #162
Merged
emir-hasanbegovic merged 2 commits intoAug 18, 2026
Conversation
Byte 3 bit 0x04 of the Xbox 360 wired report is the standard Guide/Xbox button bit, but decodeXInput360 never read it, so every XINPUT_360-family pad (including the Amazon Luna Controller) silently dropped a center-button press instead of reporting it as Guide. Confirmed the Luna's center button sets exactly this bit via a live raw-report capture on device. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
emir-hasanbegovic
added a commit
that referenced
this pull request
Aug 18, 2026
1.1.1 shipped 2026-08-17. Main has picked up two user-facing fixes since: the Guide button on XInput wired pads (#162) and the "Use wired" card action when a Bluetooth pad's cable is plugged in (#163). This keys the release docs to 1.1.2 so the tag can ship them; tag 1.1.2 derives versionCode 10102. - CHANGELOG.md: retitle Unreleased to 1.1.2, dated 2026-08-18 - changelogs/10102.txt in all 5 locales, quoting each locale's actual UI strings for the card badge and button Validated locally: `EXPECTED_VERSION_CODE=10102 python scripts/check_play_metadata.py` reports 0 errors (only the known 512x512 icon warnings). ## Releasing after merge ``` git fetch origin git tag 1.1.2 origin/main git push origin 1.1.2 ```
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.
Description
decodeXInput360(the shared decoder for everyParser::XINPUT_360/XINPUT_360_WIRELESSdevice in thekKnowntable — genuine Xbox 360controllers and its many licensed clones, plus the Amazon Luna
Controller) never read byte 3 bit
0x04of the wired report. That bitis the standard Guide/Xbox button position in the XInput wired
protocol (the same bit Linux's
xpaddriver treats asBTN_MODE); theother bits in that byte (
0x01/0x02bumpers,0x10..0x80facebuttons) were already decoded, but
0x04was dead, so any pad'scenter/Guide button silently produced no input at all instead of
XUSB_GUIDE.Found on real hardware: a live raw-report capture from an Amazon Luna
Controller (USB VID:PID
1949:041A, wired mode, from #153) showedbyte 3 going to exactly
0x04and nothing else when its center buttonwas pressed, with A/B/X/Y independently confirmed against their own
existing bits (
0x10/0x20/0x40/0x80) in the same capture. Fix isa single added line, decoding that bit the same way every other button
in the function already is, with no change to the report layout or any
other bit.
No wire-protocol changes; nothing to coordinate with
satellite,dish-linux, ordish-mac.Scope note for review: this is a generic decoder fix, not a Luna-only
special case, so it affects every device riding
XINPUT_360/XINPUT_360_WIRELESSinkKnown(Mad Catz, PDP, Hori, PowerA,Afterglow, dance pads, fight sticks, etc.). Pads without a physical
Guide button never assert that bit in hardware, so this is a no-op for
them. The only theoretical residual risk is an unlicensed clone that
reused bit
0x04for some other custom function instead of leaving itunused; if one exists, worst case is that button now also raises
Guide/Home, not a crash or corrupted input.
Type of Change
functionality to not work as expected)
How Has This Been Tested?
Added
Decode.Xbox360WiredGuideButtonSetsGuideBittousb_parsers_test.cpp, asserting byte 30x04setsXUSB_GUIDEthrough
decodeReport(Parser::XINPUT_360, ...). Full native hostsuite: 241/241 passing (
ctestacross allapp/src/test/cppbinaries).Manual testing: real Amazon Luna Controller, wired directly to an
Android phone running dish, Direct mode. Captured raw USB interrupt
reports for A/B/X/Y and the center button before the fix (center
button produced no bit at all in
wButtons); after the fix, rebuiltand reinstalled the app and confirmed the center button now reaches
the Guide/Home action end-to-end through a
satellitehost.Checklist
untouched — no Kotlin changed; clang-format skipped locally, not
installed at the pinned 22.1.4 version, but the change is a
single line matching the exact formatting of every neighboring
line in the same
ifchain, and CI's own clang-format gate willcatch it if not)
the fix reads identically to every other bit check in the same
function, so a comment here would be inconsistent with the rest
of the file)
(
CHANGELOG.md, under[Unreleased])feature works
(241/241 native host tests,
assembleDebug)