Consume inputtino's runtime joypad factory (Xbox/PS5/Switch Pro/Joy-Con) - #445
Open
kmreisi wants to merge 1 commit into
Open
Consume inputtino's runtime joypad factory (Xbox/PS5/Switch Pro/Joy-Con)#445kmreisi wants to merge 1 commit into
kmreisi wants to merge 1 commit into
Conversation
kmreisi
force-pushed
the
feature/runtime-uhid-uinput-joypads
branch
3 times, most recently
from
June 26, 2026 14:18
346011c to
9ff2504
Compare
kmreisi
marked this pull request as ready for review
June 26, 2026 14:22
kmreisi
commented
Jun 26, 2026
| # Repoint to games-on-whales/inputtino once those land on stable. | ||
| FetchContent_Declare( | ||
| inputtino | ||
| GIT_REPOSITORY https://github.com/games-on-whales/inputtino.git |
Author
There was a problem hiding this comment.
Don't merge until this has been changed.
kmreisi
force-pushed
the
feature/runtime-uhid-uinput-joypads
branch
from
June 28, 2026 06:05
9ff2504 to
79d5f1c
Compare
Replace wolf's hand-rolled per-type joypad creation with the inputtino runtime factory, so Xbox / PS5 / Switch Pro / Joy-Con all come from one code path and the rich uhid pads are used when the host exposes /dev/uhid (uinput fallback otherwise). The Switch Pro and Joy-Con support lives in inputtino now, so the old wolf-side per-controller workarounds are gone. - create joypads via inputtino::Joypad::create(Joypad::TYPE, def, prefer_uhid); drop the wolf uinput joypad wrapper (platforms/linux/uinput/joypad.cpp). - map wolf ControllerType -> Joypad::TYPE, including JOYCON_LEFT / JOYCON_RIGHT; device identities come from inputtino::Joypad::default_definition() instead of hard-coded vendor/product ids (wolf only stamps a per-session uniq on the Nintendo pads). - motion uses the generic set_gyro() / set_accel() (deg/s, m/s^2). - JoypadTypes is now the generic inputtino::Joypad (not a variant): adapt the lobby plug/unplug sites to call the base methods directly. Selecting a Joy-Con is wired through the existing per-client controller override (controllers_override / motion_controller_override); the wire protocol still only carries XBOX/PS/NINTENDO, so Joy-Cons are opt-in via that override for now. Adopting the inputtino factory is optional (the per-type API still works); this is wolf opting in. Depends on the inputtino runtime-joypad-factory stack (games-on-whales/inputtino roadmap issue games-on-whales#44 -> PRs games-on-whales#42/games-on-whales#43/games-on-whales#40/games-on-whales#37/games-on-whales#41); the FetchContent pin points at that fork's joycon branch tip until it lands on stable. Reconnect-related changes (CAP_NET_ADMIN, lobby joypad hand-off / games-on-whales#435 leak fix, replace-on-rearrival) are intentionally out of scope and come as a separate set.
kmreisi
force-pushed
the
feature/runtime-uhid-uinput-joypads
branch
from
June 28, 2026 16:06
79d5f1c to
1cbf944
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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/uhidis present and the uinput fallback otherwise. Drops wolf's hand-rolled uinput joypad wrapper.ControllerType→Joypad::TYPE, incl.JOYCON_LEFT/JOYCON_RIGHT. Device identities come frominputtino::Joypad::default_definition()— no hard-coded vendor/product ids in wolf (it only stamps a per-session uniq on the Nintendo pads).set_gyro()/set_accel().JoypadTypesis now the genericinputtino::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
FetchContentpin points at that fork's joycon branch tip until the stack lands onstable; repoint togames-on-whales/inputtinoonce it does.Built locally against the inputtino branch (full
wolfbinary links clean).