[PR #37] [4/5] UHID Nintendo Switch Pro controller #40

Open
opened 2026-10-15 12:51:32 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/inputtino/pull/37
Author: @kmreisi
Created: 4/5/2026
Status: 🔄 Open

Base: stable ← Head: feature/switch-pro-controller


📝 Commits (9)

  • 2ca4e07 Align PS5 MAC handling via shared uhid helpers
  • 7a88920 Introduce Mac struct with shared helpers
  • 342f6c3 Use pooled MAC allocation with reuse on release
  • b24e301 fix(mac): monotonic counter allocation, validate parse input
  • d010cdb refactor(uhid): move find_uhid_sys_nodes out of the header
  • b4f7fe9 test(capi): assert every switch node path, not just the first
  • 52736d1 Share get_nodes() via sys_nodes_to_dev_paths helper
  • 49d35fe feat(joypad): runtime uhid/uinput selection + self-describing udev
  • c1acbda feat(joypad): add UHID Nintendo Switch Pro controller

📊 Changes

24 files changed (+2419 additions, -278 deletions)

View changed files

📝 CMakeLists.txt (+18 -5)
📝 include/inputtino/input.hpp (+275 -47)
➕ include/inputtino/mac.hpp (+42 -0)
➕ src/host_capability.cpp (+94 -0)
➕ src/mac.cpp (+103 -0)
➕ src/udev_helpers.hpp (+63 -0)
➕ src/uhid/include/uhid/joypad_common.hpp (+64 -0)
📝 src/uhid/include/uhid/protected_types.hpp (+28 -14)
➕ src/uhid/include/uhid/switch.hpp (+124 -0)
📝 src/uhid/include/uhid/uhid.hpp (+38 -5)
📝 src/uhid/joypad_ps5.cpp (+183 -125)
➕ src/uhid/joypad_switch.cpp (+733 -0)
➕ src/uhid/uhid.cpp (+50 -0)
📝 src/uinput/include/inputtino/protected_ps5_types.hpp (+1 -1)
📝 src/uinput/include/inputtino/protected_types.hpp (+3 -1)
📝 src/uinput/joypad_nintendo.cpp (+29 -17)
📝 src/uinput/joypad_ps.cpp (+24 -33)
📝 src/uinput/joypad_utils.hpp (+38 -0)
📝 src/uinput/joypad_xbox.cpp (+8 -1)
📝 tests/CMakeLists.txt (+3 -0)

...and 4 more files

📄 Description

[4/5] in the dynamic-UHID-joypads roadmap — see #44.

A hid-nintendo-compatible Switch Pro Controller on the runtime factory: SPI stick
calibration, IMU, rumble, Bluetooth report descriptor, with the uinput pad as the
fallback. Adopts the shared Mac struct (#43) for the device address.

Backward-compatible (per-type SwitchJoypad::create unchanged). Stacks on #40.
Builds, [Switch] tests pass, Sunshine + wolf compile.


🔄 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/games-on-whales/inputtino/pull/37 **Author:** [@kmreisi](https://github.com/kmreisi) **Created:** 4/5/2026 **Status:** 🔄 Open **Base:** `stable` ← **Head:** `feature/switch-pro-controller` --- ### 📝 Commits (9) - [`2ca4e07`](https://github.com/games-on-whales/inputtino/commit/2ca4e07cd5ffb60cd3cffe17f500e6e1c067c86f) Align PS5 MAC handling via shared uhid helpers - [`7a88920`](https://github.com/games-on-whales/inputtino/commit/7a889203b0338efa5aafa2bb6442319217cfd63a) Introduce Mac struct with shared helpers - [`342f6c3`](https://github.com/games-on-whales/inputtino/commit/342f6c3a8557b58ca509d4fe09071e61dc4d6291) Use pooled MAC allocation with reuse on release - [`b24e301`](https://github.com/games-on-whales/inputtino/commit/b24e3012ec9d530ab03a08aa05092ef33d66f1ba) fix(mac): monotonic counter allocation, validate parse input - [`d010cdb`](https://github.com/games-on-whales/inputtino/commit/d010cdb4cf64f58a97651fe14263616740a3d7b8) refactor(uhid): move find_uhid_sys_nodes out of the header - [`b4f7fe9`](https://github.com/games-on-whales/inputtino/commit/b4f7fe9a36b4a9b532b83949daee8e28c5017bd9) test(capi): assert every switch node path, not just the first - [`52736d1`](https://github.com/games-on-whales/inputtino/commit/52736d1ad81b9e4d32cc863d22b3444e95694d90) Share get_nodes() via sys_nodes_to_dev_paths helper - [`49d35fe`](https://github.com/games-on-whales/inputtino/commit/49d35fe3dbce4539b65ff590a39b3fe9f28c399b) feat(joypad): runtime uhid/uinput selection + self-describing udev - [`c1acbda`](https://github.com/games-on-whales/inputtino/commit/c1acbda120af98a365632c0f8a063e8a9f5321ad) feat(joypad): add UHID Nintendo Switch Pro controller ### 📊 Changes **24 files changed** (+2419 additions, -278 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+18 -5) 📝 `include/inputtino/input.hpp` (+275 -47) ➕ `include/inputtino/mac.hpp` (+42 -0) ➕ `src/host_capability.cpp` (+94 -0) ➕ `src/mac.cpp` (+103 -0) ➕ `src/udev_helpers.hpp` (+63 -0) ➕ `src/uhid/include/uhid/joypad_common.hpp` (+64 -0) 📝 `src/uhid/include/uhid/protected_types.hpp` (+28 -14) ➕ `src/uhid/include/uhid/switch.hpp` (+124 -0) 📝 `src/uhid/include/uhid/uhid.hpp` (+38 -5) 📝 `src/uhid/joypad_ps5.cpp` (+183 -125) ➕ `src/uhid/joypad_switch.cpp` (+733 -0) ➕ `src/uhid/uhid.cpp` (+50 -0) 📝 `src/uinput/include/inputtino/protected_ps5_types.hpp` (+1 -1) 📝 `src/uinput/include/inputtino/protected_types.hpp` (+3 -1) 📝 `src/uinput/joypad_nintendo.cpp` (+29 -17) 📝 `src/uinput/joypad_ps.cpp` (+24 -33) 📝 `src/uinput/joypad_utils.hpp` (+38 -0) 📝 `src/uinput/joypad_xbox.cpp` (+8 -1) 📝 `tests/CMakeLists.txt` (+3 -0) _...and 4 more files_ </details> ### 📄 Description **`[4/5]` in the dynamic-UHID-joypads roadmap — see #44.** A `hid-nintendo`-compatible Switch Pro Controller on the runtime factory: SPI stick calibration, IMU, rumble, Bluetooth report descriptor, with the uinput pad as the fallback. Adopts the shared `Mac` struct (#43) for the device address. Backward-compatible (per-type `SwitchJoypad::create` unchanged). Stacks on #40. Builds, `[Switch]` tests pass, Sunshine + wolf compile. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
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
games-on-whales/inputtino#40
No description provided.