diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fd4ddd9..b79928f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ computer. Those lines say "update Satellite too". --- +## [Unreleased] + +### Fixed + +- The Xbox/Guide button on XInput-style wired USB controllers (Xbox 360 + and its many licensed clones, plus the Amazon Luna Controller) now + works. Before this fix, pressing it did nothing. + +--- + ## [1.1.1] - 2026-08-17 ### Fixed diff --git a/app/src/main/cpp/usb_parsers.cpp b/app/src/main/cpp/usb_parsers.cpp index e843119a..7b12237d 100644 --- a/app/src/main/cpp/usb_parsers.cpp +++ b/app/src/main/cpp/usb_parsers.cpp @@ -720,6 +720,7 @@ bool decodeXInput360(const uint8_t* buf, size_t len, DeviceState& s) { if (buf[2] & 0x80) b |= XUSB_THUMB_R; if (buf[3] & 0x01) b |= XUSB_LB; if (buf[3] & 0x02) b |= XUSB_RB; + if (buf[3] & 0x04) b |= XUSB_GUIDE; if (buf[3] & 0x10) b |= XUSB_A; if (buf[3] & 0x20) b |= XUSB_B; if (buf[3] & 0x40) b |= XUSB_X; diff --git a/app/src/test/cpp/usb_parsers_test.cpp b/app/src/test/cpp/usb_parsers_test.cpp index 757430d1..1afe463a 100644 --- a/app/src/test/cpp/usb_parsers_test.cpp +++ b/app/src/test/cpp/usb_parsers_test.cpp @@ -418,6 +418,16 @@ TEST(Decode, Xbox360WirelessDecodesLikeWired) { EXPECT_EQ(wired.sLX, wireless.sLX); } +TEST(Decode, Xbox360WiredGuideButtonSetsGuideBit) { + std::vector r(14, 0); + r[0] = 0x00; + r[3] = 0x04; // Guide (same bit the Amazon Luna Controller's center button reports) + DeviceState s; + ParserState p; + ASSERT_TRUE(decodeReport(Parser::XINPUT_360, r.data(), r.size(), s, &p)); + EXPECT_TRUE(s.wButtons & XUSB_GUIDE); +} + TEST(Rumble, Xbox360WirelessWrapsFrame) { uint8_t out[64]; size_t n = buildRumbleReport(Parser::XINPUT_360_WIRELESS, 0xFF00, 0x8000, 7, out, sizeof(out));