[PR #445] Consume inputtino's runtime joypad factory (Xbox/PS5/Switch Pro/Joy-Con) #474

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

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/wolf/pull/445
Author: @kmreisi
Created: 6/24/2026
Status: 🔄 Open

Base: beta ← Head: feature/runtime-uhid-uinput-joypads


📝 Commits (1)

  • 1cbf944 feat(input): consume inputtino's runtime joypad factory

📊 Changes

13 files changed (+578 additions, -395 deletions)

View changed files

📝 .dockerignore (+1 -1)
📝 src/core/CMakeLists.txt (+4 -2)
📝 src/core/src/core/input.hpp (+4 -23)
➖ src/core/src/platforms/linux/uinput/joypad.cpp (+0 -207)
📝 src/moonlight-server/control/input_handler.cpp (+135 -135)
📝 src/moonlight-server/events/events.hpp (+8 -1)
📝 src/moonlight-server/runners/docker.cpp (+36 -8)
📝 src/moonlight-server/sessions/lobbies.cpp (+4 -12)
📝 src/moonlight-server/state/configTOML.cpp (+2 -0)
📝 src/moonlight-server/state/serialised_config.hpp (+5 -0)
📝 src/moonlight-server/wolf.cpp (+5 -0)
📝 tests/platforms/linux/inputtino.cpp (+3 -3)
📝 tests/platforms/linux/uhid.cpp (+371 -3)

📄 Description

Consolidates the controller work into one change: wolf opts into inputtino's runtime joypad factory, and Switch Pro + Joy-Con come along for free from inputtino (this supersedes #385, which I closed).

Adopting the factory is optional — inputtino keeps the per-type API (PS5Joypad::create, set_motion, …) working, so this is wolf choosing to migrate, not a forced change.

What it does

  • Creates joypads via inputtino::Joypad::create(Joypad::TYPE, def, prefer_uhid) — one code path for Xbox / PS5 / Switch Pro / Joy-Con, using the rich uhid pad when /dev/uhid is present and the uinput fallback otherwise. Drops wolf's hand-rolled uinput joypad wrapper.
  • Maps wolf ControllerType → Joypad::TYPE, incl. JOYCON_LEFT/JOYCON_RIGHT. Device identities come from inputtino::Joypad::default_definition() — no hard-coded vendor/product ids in wolf (it only stamps a per-session uniq on the Nintendo pads).
  • Motion via the generic set_gyro() / set_accel().
  • JoypadTypes is now the generic inputtino::Joypad (not a variant); the lobby plug/unplug sites call the base methods directly.

Joy-Con selection is wired through the existing per-client override (controllers_override / motion_controller_override) — the wire protocol only carries XBOX/PS/NINTENDO, so a Joy-Con is opt-in via that override for now (a future Moonlight extension could send individual Joy-Cons).

Scope / dependencies

  • Consumes the full inputtino runtime-joypad-factory stack — roadmap: games-on-whales/inputtino#44 (PRs games-on-whales/inputtino#42 / #43 / #40 / #37 / #41). The FetchContent pin points at that fork's joycon branch tip until the stack lands on stable; repoint to games-on-whales/inputtino once it does.
  • Reconnect-related changes (CAP_NET_ADMIN, lobby joypad hand-off / #435 leak fix, replace-on-rearrival) are intentionally out of scope and come as a separate set.

Built locally against the inputtino branch (full wolf binary links clean).


🔄 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/wolf/pull/445 **Author:** [@kmreisi](https://github.com/kmreisi) **Created:** 6/24/2026 **Status:** 🔄 Open **Base:** `beta` ← **Head:** `feature/runtime-uhid-uinput-joypads` --- ### 📝 Commits (1) - [`1cbf944`](https://github.com/games-on-whales/wolf/commit/1cbf9446449134808eb44ce698a55428967ed395) feat(input): consume inputtino's runtime joypad factory ### 📊 Changes **13 files changed** (+578 additions, -395 deletions) <details> <summary>View changed files</summary> 📝 `.dockerignore` (+1 -1) 📝 `src/core/CMakeLists.txt` (+4 -2) 📝 `src/core/src/core/input.hpp` (+4 -23) ➖ `src/core/src/platforms/linux/uinput/joypad.cpp` (+0 -207) 📝 `src/moonlight-server/control/input_handler.cpp` (+135 -135) 📝 `src/moonlight-server/events/events.hpp` (+8 -1) 📝 `src/moonlight-server/runners/docker.cpp` (+36 -8) 📝 `src/moonlight-server/sessions/lobbies.cpp` (+4 -12) 📝 `src/moonlight-server/state/configTOML.cpp` (+2 -0) 📝 `src/moonlight-server/state/serialised_config.hpp` (+5 -0) 📝 `src/moonlight-server/wolf.cpp` (+5 -0) 📝 `tests/platforms/linux/inputtino.cpp` (+3 -3) 📝 `tests/platforms/linux/uhid.cpp` (+371 -3) </details> ### 📄 Description Consolidates the controller work into one change: **wolf opts into inputtino's runtime joypad factory**, and Switch Pro + Joy-Con come along for free from inputtino (this supersedes #385, which I closed). Adopting the factory is **optional** — inputtino keeps the per-type API (`PS5Joypad::create`, `set_motion`, …) working, so this is wolf choosing to migrate, not a forced change. **What it does** - Creates joypads via `inputtino::Joypad::create(Joypad::TYPE, def, prefer_uhid)` — one code path for Xbox / PS5 / Switch Pro / Joy-Con, using the rich uhid pad when `/dev/uhid` is present and the uinput fallback otherwise. Drops wolf's hand-rolled uinput joypad wrapper. - Maps wolf `ControllerType` → `Joypad::TYPE`, incl. `JOYCON_LEFT`/`JOYCON_RIGHT`. Device identities come from `inputtino::Joypad::default_definition()` — no hard-coded vendor/product ids in wolf (it only stamps a per-session uniq on the Nintendo pads). - Motion via the generic `set_gyro()` / `set_accel()`. - `JoypadTypes` is now the generic `inputtino::Joypad` (not a variant); the lobby plug/unplug sites call the base methods directly. Joy-Con selection is wired through the existing per-client override (`controllers_override` / `motion_controller_override`) — the wire protocol only carries XBOX/PS/NINTENDO, so a Joy-Con is opt-in via that override for now (a future Moonlight extension could send individual Joy-Cons). **Scope / dependencies** - Consumes the full inputtino runtime-joypad-factory stack — roadmap: games-on-whales/inputtino#44 (PRs games-on-whales/inputtino#42 / #43 / #40 / #37 / #41). The `FetchContent` pin points at that fork's joycon branch tip until the stack lands on `stable`; repoint to `games-on-whales/inputtino` once it does. - Reconnect-related changes (CAP_NET_ADMIN, lobby joypad hand-off / #435 leak fix, replace-on-rearrival) are intentionally out of scope and come as a separate set. Built locally against the inputtino branch (full `wolf` binary links clean). --- <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/wolf#474
No description provided.