Repository navigation
feat(profiles): expose rear paddles on the generic gamepad - #240
Open
iphikles3000 wants to merge 2 commits into
Open
iphikles3000 wants to merge 2 commits into
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
|
|
6 of 18 tasks
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
|
This branch has not been deployed
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
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.