Skip to content

fix(vader5): map M1..M4 to BTN_TRIGGER_HAPPY1..4 (Steam Elite paddle slots)#353

Merged
BANANASJIM merged 1 commit into
mainfrom
fix/vader5-paddle-mapping-regression
May 27, 2026
Merged

fix(vader5): map M1..M4 to BTN_TRIGGER_HAPPY1..4 (Steam Elite paddle slots)#353
BANANASJIM merged 1 commit into
mainfrom
fix/vader5-paddle-mapping-regression

Conversation

@BANANASJIM
Copy link
Copy Markdown
Owner

@BANANASJIM BANANASJIM commented May 27, 2026

Summary

  • Xbox Elite Series 2 evdev spec reserves BTN_TRIGGER_HAPPY1..4 for back paddles P1..P4. padctl masquerades Vader 5 Pro as Xbox Elite Series 2 (vid=0x045e pid=0x0b00), so the same slot reservation applies.
  • PR uhid: emit per-button Usage items instead of Usage Min/Max range #235 (1535d8a) enabled C/Z/LM/RM in [output.buttons] and placed them at HAPPY1..4, displacing the real back paddles M1..M4 to HAPPY5..8 which Steam/games do not recognize as paddles.
  • User-observed regression on Flydigi Vader 5 Pro hardware: pressing the extra face buttons (C/Z) appeared as back-paddle input; pressing the actual back paddles produced no input.
  • Move M1..M4 to HAPPY1..4 (preserving the M2/M3 swap so Vader M2 lands at the Steam Elite P3 slot per PR fix: restore Vader 5 M2 Steam paddle label #323's intent). Push C/Z/LM/RM/O to HAPPY9..13 — they keep stable evdev codes but no longer collide with the paddle reserved range.
  • Update src/io/uhid_descriptor.zig companion test that asserted the old hard-coded HAPPY values and propagated USAGE-number offsets (HAPPY1=usage 17, HAPPY9=usage 25, etc.).
  • Add regression test in src/test/validate_e2e_test.zig:
    1. M1..M4 occupy BTN_TRIGGER_HAPPY1..4 (positive lock, including M2/M3 swap)
    2. None of C/Z/LM/RM/O fall in BTN_TRIGGER_HAPPY1..4 (structural invariant — catches the PR uhid: emit per-button Usage items instead of Usage Min/Max range #235 class of regression)

Test plan

  • zig build test green in canonical Docker image (1558 tests, 7 skipped) — pre-push hook
  • Falsifiability: setting M1 = BTN_TRIGGER_HAPPY5 in TOML fires the new positive-lock test and the existing uhid_descriptor test (2 failures, both reverted)
  • User local hardware verification with evtest /dev/input/event26 — physical M1..M4 → HAPPY1..4 confirmed; physical C/Z/LM/RM → HAPPY9..12 confirmed
  • CI matrix: check / coverage / lean / e2e / install / pkg / systemd hardening / distro-check / tsan

Refs #235

Summary by CodeRabbit

  • Bug Fixes

    • Corrected button mappings for the Flydigi Vader 5 Pro controller to ensure proper Steam and console button label recognition.
  • Tests

    • Added validation tests for paddle button assignments to prevent regressions.

Review Change Stack

…slots)

Xbox Elite Series 2 evdev spec reserves BTN_TRIGGER_HAPPY1..4 for back
paddles P1..P4. PR #235 enabled C/Z/LM/RM in [output.buttons] and placed
them at HAPPY1..4, displacing the physical back paddles (M1..M4) to
HAPPY5..8 where Steam does not recognize them. Pressing extra face
buttons appeared as paddle presses; pressing real paddles produced no
input.

Move M1..M4 to HAPPY1..4 (preserving the M2/M3 swap so Vader M2 lands
at P3 per Steam Elite labeling). Push C/Z/LM/RM/O to HAPPY9..13 — they
keep stable evdev codes but no longer collide with paddle reserved slots.

Add regression test asserting (a) M1..M4 occupy HAPPY1..4, (b) none of
C/Z/LM/RM/O fall in HAPPY1..4.

Refs #235
@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
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f77b12e4-17e4-4abc-8992-54a9578c6e89

📥 Commits

Reviewing files that changed from the base of the PR and between cb990be and 271d917.

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

📝 Walkthrough

Walkthrough

This PR updates the Flydigi Vader 5 controller button mappings in the device configuration, reassigning M1–M4 paddle slots and face buttons to different trigger-happy codes. Unit and E2E test expectations are updated and expanded to validate the new button-to-HID-usage relationships.

Changes

Vader 5 Button Mapping Update

Layer / File(s) Summary
Vader 5 button mapping configuration
devices/flydigi/vader5.toml
M1–M4 paddle slots and C, Z, LM, RM, O face/extra buttons are reassigned to new BTN_TRIGGER_HAPPY codes; M2/M3 swap slots, C/Z/LM/RM move to BTN_TRIGGER_HAPPY9–12, and O maps to BTN_TRIGGER_HAPPY13.
Unit test expectations for button ordering
src/io/uhid_descriptor.zig
Vader 5 button-mapping assertions updated to match the new M1–M4 trigger-happy codes and the expected HID Usage byte sequence in the generated descriptor.
E2E regression test for paddle slots
src/test/validate_e2e_test.zig
New regression test section validates that paddle slots M1–M4 correspond exactly to BTN_TRIGGER_HAPPY1–4, and that face/extra buttons do not collide with paddle-slot codes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • BANANASJIM/padctl#235: The PR aligns with the per-button HID Usage(N) emission logic that drives correct evdev↔HID mapping.
  • BANANASJIM/padctl#323: Both PRs adjust the Vader 5 M2/M3 trigger-happy ordering and related test expectations.
  • BANANASJIM/padctl#58: Both modify the Vader 5 [output.buttons] evdev button mapping table.

Poem

🐰 In Zig and TOML, buttons dance anew,
M1 through M4 find slots bright and true,
With tests to guide them, from E2E's care,
The Vader 5 now maps with buttons fair!

🚥 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 directly and accurately describes the main change: remapping Vader 5 Pro paddle buttons M1..M4 to BTN_TRIGGER_HAPPY1..4 for Xbox Elite Series 2 compatibility.
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-mapping-regression

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 b42abd2 into main May 27, 2026
38 checks passed
@BANANASJIM BANANASJIM deleted the fix/vader5-paddle-mapping-regression branch May 27, 2026 21:44
@BANANASJIM BANANASJIM mentioned this pull request May 27, 2026
2 tasks
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