Repository navigation
feat(profiles): expose rear paddles on the generic gamepad - #240
iphikles3000 wants to merge 2 commits into
Conversation
The Generic Controller now reports four rear paddles so streaming hosts can forward controllers with extra buttons (e.g. Xbox Elite paddles or 8BitDo L4/R4/PL/PR) without impersonating a specific controller. - HID descriptor: buttons 17-20 plus 4 bits of padding after the axes; the input report grows from 9 to 10 bytes. - gamepad_profile_support() reports four rear paddles for generic. - Linux uinput: paddles use BTN_TRIGGER_HAPPY5-8 (xpad Elite convention). - Windows VHF queue: the paddle byte counts as discrete state so short paddle presses are not coalesced away. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RbsW5KwLNXUJBNjp2Rz5B
|
|
Address SonarCloud findings: build the generic paddle byte with std::byte and use "using enum" in the paddle report test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RbsW5KwLNXUJBNjp2Rz5B
|
|
I don't see the value in adding these to the generic controller. In fact I was thinking about removing the generic controller, as there's not really any reason to use it. I am planning to add support for Xbox Elite pads, I just need to get a physical gamepad so I can properly test it. |
|
Understandable. The games I tested don't benefit from the added buttons since they don't recognize the generic gamepad. Xbox Elite could be the solution. Unfortunately I also do not have one handy. Would it help you acquire one if I donated/bought a lifetime license? |
That's kind of you, but it's not necessary. |
|
I was able to find one at a decent price on ebay, assuming it shows up, I'll start this work soon. |



Description
Moonlight can send four rear paddles (PADDLE1-4), but none of the built-in profiles exposes them, so controllers with extra buttons (Xbox Elite paddles, 8BitDo Ultimate 2 L4/R4/PL/PR, ...) lose those inputs on the host. This PR adds four rear paddles to the generic gamepad profile, which does not need to match a real controller's report layout.
gamepad_profile_support()reportssupported_rear_paddle_count = 4forGamepadProfileKind::generic(all other profiles unchanged).uinput: generic paddles useBTN_TRIGGER_HAPPY5-BTN_TRIGGER_HAPPY8(xpad's Elite paddle convention).Note for reviewers: the generic report layout changes (one byte appended, buttons 1-16 and the axes keep their positions). Games with a saved DirectInput mapping for the generic controller should be unaffected, but it is a visible change in
joy.cpl(20 instead of 16 buttons).Screenshot
Issues Fixed or Closed
Roadmap Issues
Testing
Added/updated tests:
ReportTest.PacksStandardGamepadPaddles(new): paddle bits land in byte 9.ReportTest.PacksStandardGamepadReport: checks the new paddle byte is zero.GamepadAdapterTest.RejectsUnsupportedPartialUpdates: paddle1 is now accepted on the generic profile.WindowsVhfInputReportQueueTest.PreservesGenericRearPaddleTransitions(new); existing generic queue tests use the 10-byte report.Run locally on Linux (Ubuntu 24.04, GCC 13): all report, adapter, profile and Windows VHF queue unit tests pass. Tests that need a writable
/dev/uinputor/dev/uhidcould not run in that environment, so the Linuxuinputpaddle path is compiled but not exercised. The build usedLIBVIRTUALHID_WARNINGS_AS_ERRORS=OFFbecause of a pre-existing GCC 13unused-parameterwarning inuhid_backend.cpp, unrelated to this change.Manual validation on Windows: an earlier version of the descriptor/report change (without the Linux and VHF queue parts) was built into Sunshine and streamed from Moonlight on an LG webOS TV with an 8BitDo Ultimate 2 in D-input mode.
joy.cplshowed the generic controller with 20 buttons; the extra buttons registered as buttons 17-20: R4 = 17 (paddle1), L4 = 18 (paddle2), PR = 19 (paddle3), PL = 20 (paddle4). This matches SDL's paddle order (upper right, upper left, lower right, lower left). macOS was not tested.Type of Change
Checklist
AI Usage
See our AI usage policy.
Code, tests and this description were written by Claude; I reviewed and tested the result on my setup.