Skip to content

fix(vader5): restore back-paddle evdev codes to BTN_TRIGGER_HAPPY5-8 (real Elite 2 layout)#389

Merged
BANANASJIM merged 1 commit into
mainfrom
fix/vader5-paddle-codes-353
Jun 7, 2026
Merged

fix(vader5): restore back-paddle evdev codes to BTN_TRIGGER_HAPPY5-8 (real Elite 2 layout)#389
BANANASJIM merged 1 commit into
mainfrom
fix/vader5-paddle-codes-353

Conversation

@BANANASJIM

@BANANASJIM BANANASJIM commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Regression

PR #353 (b42abd2) moved the Vader 5 back paddles M1-M4 from BTN_TRIGGER_HAPPY5-8 to HAPPY1-4 on the unverified assumption that "Steam Elite paddle slots = HAPPY1-4". Its hardware check only confirmed (via evtest) that the evdev codes were emitted, not that Steam recognized them as paddles. On a real Vader 5 + Steam this regressed paddle recognition — Steam stopped reading the back paddles.

Fix (hardware-confirmed)

The Vader 5 masquerades as an Xbox Elite Series 2 (045e:0b00). The real Elite 2 exposes its four back paddles P1-P4 as BTN_TRIGGER_HAPPY5-8 on Linux (xpad driver, PR #195); SDL's hidapi Xbox driver reads paddle state from that layout. Restoring M1-M4 to HAPPY5-8 was verified on a real Vader 5 + Steam to make paddles P1-P4 respond again.

Final [output.buttons] layout:

No collision: paddles occupy 5-8, extras occupy 9-13.

Evidence

Changes

  • devices/flydigi/vader5.toml: M1-M4 -> HAPPY5/7/6/8; comment cites real-hardware basis.
  • src/test/validate_e2e_test.zig: positive lock asserts M1-M4 = HAPPY5/7/6/8; structural-invariant asserts paddle range HAPPY5-8 and C/Z/LM/RM/O not in it.
  • src/io/uhid_descriptor.zig: Vader 5 descriptor test re-derives expected HID usages (HAPPY5-8 -> 21/23/22/24) and asserts M1-M4 = HAPPY5/7/6/8.

Test plan

  • ./scripts/padctl-docker test -> EXIT=0.
  • Falsifiability: setting M1 back to HAPPY1 fails both updated lock tests (validate_e2e positive lock + uhid_descriptor Vader 5 order); restored after.
  • zig fmt --check (0.15.2) clean on changed .zig files.

Summary by CodeRabbit

  • Bug Fixes

    • Corrected button mapping configuration for Vader 5 controller M1–M4 buttons to use updated trigger codes.
  • Tests

    • Updated hardware descriptor and regression tests to validate the corrected button mappings for the Vader 5 controller.

…(real Elite 2 layout)

PR #353 moved the Vader 5 back paddles M1-M4 from BTN_TRIGGER_HAPPY5-8 to
HAPPY1-4 on the unverified assumption that "Steam Elite paddle slots = HAPPY1-4".
That hardware check only confirmed via evtest that the codes were emitted, not
that Steam recognized them as paddles. On a real Vader 5 + Steam this regressed
paddle recognition: Steam stopped reading the back paddles entirely.

The real Xbox Elite Series 2 (which the Vader 5 masquerades as, 045e:0b00)
exposes its four back paddles P1-P4 as BTN_TRIGGER_HAPPY5-8 on Linux (xpad
driver, PR #195); SDL's hidapi Xbox driver reads paddle state from that layout.
Restoring M1-M4 to HAPPY5-8 was hardware-confirmed to make Steam's P1-P4 paddles
respond again.

This reverts only the paddle codes. The M2/M3 swap (PR #323, Steam Elite P3/P2
order) is preserved, and the non-paddle extras C/Z/LM/RM/O stay at HAPPY9-13
where PR #353 correctly moved them out of the paddle range (avoids the #235
collision). Final layout: paddles M1-M4 = HAPPY5-8, extras = HAPPY9-13, no
collision.

Tests:
- validate_e2e_test.zig: positive lock now asserts M1-M4 = HAPPY5/7/6/8;
  structural-invariant asserts paddle range HAPPY5-8 and C/Z/LM/RM/O not in it.
- uhid_descriptor.zig: Vader 5 descriptor test re-derives expected HID usages
  (HAPPY5-8 -> 21/23/22/24) and asserts M1-M4 = HAPPY5/7/6/8.
- Docker test suite passes; falsifiability verified (M1=HAPPY1 fails both locks).
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 68c812f9-6eca-40f4-87ba-fdeccb13b557

📥 Commits

Reviewing files that changed from the base of the PR and between 9915680 and aa83dcf.

📒 Files selected for processing (3)
  • devices/flydigi/vader5.toml
  • src/io/uhid_descriptor.zig
  • src/test/validate_e2e_test.zig

📝 Walkthrough

Walkthrough

The Flydigi Vader 5 controller's M1–M4 extra button mappings are remapped from trigger-happy slots 1–4 to slots 5, 7, 6, and 8 respectively. The device configuration, unit test descriptors, and E2E regression tests are all updated consistently to validate the new mapping.

Changes

Vader 5 M1–M4 Button Remapping

Layer / File(s) Summary
Device configuration and descriptor unit test
devices/flydigi/vader5.toml, src/io/uhid_descriptor.zig
Vader 5 M1–M4 buttons are remapped to BTN_TRIGGER_HAPPY codes 5, 7, 6, and 8; the unit test assertions are updated to verify the new button codes and their corresponding HID usage indices.
E2E regression test updates
src/test/validate_e2e_test.zig
Paddle-slot regression tests now expect M1–M4 to occupy trigger-happy slots 5–8 instead of 1–4, and face-button occupancy assertions are adjusted to validate no overlap with the remapped slots.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • BANANASJIM/padctl#323: Updates Flydigi Vader 5 M2/M3 trigger-happy code ordering in the same button mapping configuration.
  • BANANASJIM/padctl#353: Also remaps Vader 5 M1–M4 evdev/HID button mappings and updates corresponding test assertions, but to a different BTN_TRIGGER_HAPPY range.
  • BANANASJIM/padctl#235: Updates uhid_descriptor.zig to emit per-button HID Usage items with BTN_* → HID usage mapping, affecting the same descriptor button-code translation path.

Poem

🐰 Five buttons dance in paddle's glow,
M1 through M4, where do they go?
From slots one-through-four we say goodbye,
To five, six, seven, eight—they leap and fly!
Tests verify the new array,
Buttons mapped and coded today!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: restoring Vader 5 back-paddle evdev codes to BTN_TRIGGER_HAPPY5-8 to match real Elite 2 layout, which directly corresponds to the updates made across all three modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/vader5-paddle-codes-353

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@BANANASJIM BANANASJIM merged commit 3e49f4f into main Jun 7, 2026
40 checks passed
@BANANASJIM BANANASJIM deleted the fix/vader5-paddle-codes-353 branch June 7, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant