[PR #19] [MERGED] Add D-pad direction targets for back-paddle mapping (new modular architecture) #157

Closed
opened 2026-10-22 05:06:49 +00:00 by roman · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/safijari/openpuck/pull/19
Author: @Copilot
Created: 6/9/2026
Status: ✅ Merged
Merged: 6/11/2026
Merged by: @safijari

Base: main ← Head: copilot/17


📝 Commits (4)

  • 44bd5fd Add d-pad options for back paddle mapping
  • d67d3b2 Merge main and port dpad back-mapping
  • 419a080 Document hat mapping for back-paddle dpad codes
  • 1d43328 Merge branch 'main' into copilot/17

📊 Changes

8 files changed (+22 additions, -8 deletions)

View changed files

📝 OpenPuck/config.cpp (+1 -1)
📝 OpenPuck/config.h (+1 -1)
📝 OpenPuck/gamepad_util.cpp (+2 -1)
📝 OpenPuck/mode_switch_hori.cpp (+11 -0)
📝 OpenPuck/mode_switch_pro.cpp (+2 -1)
📝 OpenPuck/mode_xinput.cpp (+3 -2)
📝 OpenPuck/serial_console.cpp (+1 -1)
📝 docs/index.html (+1 -1)

📄 Description

Back paddles were configurable only to face/shoulder/system buttons, which prevented mapping them to directional pad input. This PR extends the mapping model so each paddle can emit D-pad Up/Down/Left/Right across supported controller output modes.

This was updated to align with the new modular architecture after merging latest main, with conflict resolution that preserved the architecture split and reapplied the D-pad mapping behavior in the new module layout.

  • Web config UI

    • Added new back-paddle mapping options in docs/index.html:
      • D-pad Up (12)
      • D-pad Down (13)
      • D-pad Left (14)
      • D-pad Right (15)
  • Firmware mapping model (modularized)

    • Extended back-button code space to include 12..15 for D-pad directions in the modular code paths.
    • Updated OpenPuck/mode_xinput.cpp (codeToXB) to map new codes to XInput D-pad bits.
    • Updated OpenPuck/gamepad_util.cpp (psOrBackCode) to map new codes to internal Steam/PS-style directional flags.
    • Updated OpenPuck/mode_switch_pro.cpp (codeToJc) to map new codes to Switch Pro directional bits.
    • Updated OpenPuck/mode_switch_hori.cpp to bridge mapped paddle D-pad codes into HORIPAD hat output.
  • Operator-facing config/docs strings

    • Updated inline mapping comments and serial K command help text to reflect the expanded code range.
// Back-paddle code -> XInput
static uint16_t codeToXB(uint8_t c){
  switch(c){
    // ...
    case 12:return XB_DUP;
    case 13:return XB_DDOWN;
    case 14:return XB_DLEFT;
    case 15:return XB_DRIGHT;
    default:return 0;
  }
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/safijari/openpuck/pull/19 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 6/9/2026 **Status:** ✅ Merged **Merged:** 6/11/2026 **Merged by:** [@safijari](https://github.com/safijari) **Base:** `main` ← **Head:** `copilot/17` --- ### 📝 Commits (4) - [`44bd5fd`](https://github.com/safijari/openpuck/commit/44bd5fd84a72dee4cc3c0d540d1486cc4c2b8349) Add d-pad options for back paddle mapping - [`d67d3b2`](https://github.com/safijari/openpuck/commit/d67d3b2738cc50ad47b7c5e61f729b5c59a313fe) Merge main and port dpad back-mapping - [`419a080`](https://github.com/safijari/openpuck/commit/419a080fbb2623741277f745f4fad413196c323b) Document hat mapping for back-paddle dpad codes - [`1d43328`](https://github.com/safijari/openpuck/commit/1d433286089f78cba06be982ad54bee202933c20) Merge branch 'main' into copilot/17 ### 📊 Changes **8 files changed** (+22 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `OpenPuck/config.cpp` (+1 -1) 📝 `OpenPuck/config.h` (+1 -1) 📝 `OpenPuck/gamepad_util.cpp` (+2 -1) 📝 `OpenPuck/mode_switch_hori.cpp` (+11 -0) 📝 `OpenPuck/mode_switch_pro.cpp` (+2 -1) 📝 `OpenPuck/mode_xinput.cpp` (+3 -2) 📝 `OpenPuck/serial_console.cpp` (+1 -1) 📝 `docs/index.html` (+1 -1) </details> ### 📄 Description Back paddles were configurable only to face/shoulder/system buttons, which prevented mapping them to directional pad input. This PR extends the mapping model so each paddle can emit D-pad Up/Down/Left/Right across supported controller output modes. This was updated to align with the new modular architecture after merging latest `main`, with conflict resolution that preserved the architecture split and reapplied the D-pad mapping behavior in the new module layout. - **Web config UI** - Added new back-paddle mapping options in `docs/index.html`: - `D-pad Up` (12) - `D-pad Down` (13) - `D-pad Left` (14) - `D-pad Right` (15) - **Firmware mapping model (modularized)** - Extended back-button code space to include `12..15` for D-pad directions in the modular code paths. - Updated `OpenPuck/mode_xinput.cpp` (`codeToXB`) to map new codes to XInput D-pad bits. - Updated `OpenPuck/gamepad_util.cpp` (`psOrBackCode`) to map new codes to internal Steam/PS-style directional flags. - Updated `OpenPuck/mode_switch_pro.cpp` (`codeToJc`) to map new codes to Switch Pro directional bits. - Updated `OpenPuck/mode_switch_hori.cpp` to bridge mapped paddle D-pad codes into HORIPAD hat output. - **Operator-facing config/docs strings** - Updated inline mapping comments and serial `K` command help text to reflect the expanded code range. ```cpp // Back-paddle code -> XInput static uint16_t codeToXB(uint8_t c){ switch(c){ // ... case 12:return XB_DUP; case 13:return XB_DDOWN; case 14:return XB_DLEFT; case 15:return XB_DRIGHT; default:return 0; } } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
roman 2026-10-22 05:06:49 +00:00
Sign in to join this conversation.
No labels
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
safijari/openpuck#157
No description provided.