[PR #385] [CLOSED] Add Nintendo Switch Pro Controller support #433

Closed
opened 2026-10-15 13:00:32 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/wolf/pull/385
Author: @kmreisi
Created: 4/5/2026
Status: ❌ Closed

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


📝 Commits (9)

  • a0de83d Support Switch Pro motion input
  • b4bceac Swap Nintendo face buttons for Switch Pro Controller
  • f7872c8 Add Switch Pro udev identity and skip evdev joystick for SDL HIDAPI
  • 1b3ba95 Fix SwitchJoypad namespace for variant type resolution
  • b2b821b Expose all Switch device nodes and fix fake-udev event ordering
  • f4eecad Replace existing controller on re-arrival instead of skipping
  • 9f30800 Fix Switch Pro Controller IMU axis mapping
  • 8c40bcb Add Joy-Con Left and Right controller support
  • 6a36bf4 Remove button and IMU workarounds for Switch controllers

📊 Changes

6 files changed (+726 additions, -54 deletions)

View changed files

📝 .dockerignore (+1 -1)
📝 src/core/src/platforms/linux/uinput/joypad.cpp (+229 -15)
📝 src/moonlight-server/control/input_handler.cpp (+81 -27)
📝 src/moonlight-server/runners/docker.cpp (+40 -10)
📝 src/moonlight-server/state/serialised_config.hpp (+2 -0)
📝 tests/platforms/linux/uhid.cpp (+373 -1)

📄 Description

Summary

Adds full Nintendo Switch Pro Controller support, enabling:

  • Gyroscope and accelerometer motion forwarding (requests motion events from Moonlight for Nintendo controller types, same as already done for PS5)
  • Proper Pro Controller identity with Bluetooth bus, stable MAC-based UNIQ, and correct VID/PID so hid-nintendo binds and SDL recognizes the device
  • Only hidraw and IMU evdev nodes are exposed to the container (the evdev joystick node is skipped to prevent SDL from creating a duplicate controller via both HIDAPI and evdev paths)
  • Face button remapping (A↔B, X↔Y) via a translate_buttons() helper to compensate for SDL HIDAPI's Nintendo→Xbox remap on read
  • Tests covering Switch metadata consistency, reconnect plug/unplug, and replayed Moonlight packet ranges

Dependencies

Requires the inputtino Switch Pro UHID backend: games-on-whales/inputtino#37


🔄 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/385 **Author:** [@kmreisi](https://github.com/kmreisi) **Created:** 4/5/2026 **Status:** ❌ Closed **Base:** `stable` ← **Head:** `feature/switch-pro-controller` --- ### 📝 Commits (9) - [`a0de83d`](https://github.com/games-on-whales/wolf/commit/a0de83db4a93e01afc9bb60b61116f6f4b1f7148) Support Switch Pro motion input - [`b4bceac`](https://github.com/games-on-whales/wolf/commit/b4bceacb75c805d8cea8ad86f500287008b766f0) Swap Nintendo face buttons for Switch Pro Controller - [`f7872c8`](https://github.com/games-on-whales/wolf/commit/f7872c8cc11294abe3b469463316084c3ba8d8ce) Add Switch Pro udev identity and skip evdev joystick for SDL HIDAPI - [`1b3ba95`](https://github.com/games-on-whales/wolf/commit/1b3ba9527e221bafb21eb780db35aecbd58350aa) Fix SwitchJoypad namespace for variant type resolution - [`b2b821b`](https://github.com/games-on-whales/wolf/commit/b2b821be33256ffb64709ddf6b6035f4fbc431bd) Expose all Switch device nodes and fix fake-udev event ordering - [`f4eecad`](https://github.com/games-on-whales/wolf/commit/f4eecadd4d000fe7add28ad382189ad835e0ace5) Replace existing controller on re-arrival instead of skipping - [`9f30800`](https://github.com/games-on-whales/wolf/commit/9f30800e3cc3afda6bbb6f40476a299d40c13ef1) Fix Switch Pro Controller IMU axis mapping - [`8c40bcb`](https://github.com/games-on-whales/wolf/commit/8c40bcbf9966c3ef4ae1a0a555eb9ad8effb750c) Add Joy-Con Left and Right controller support - [`6a36bf4`](https://github.com/games-on-whales/wolf/commit/6a36bf4c4287805c89a41c416066c1c7248b8eca) Remove button and IMU workarounds for Switch controllers ### 📊 Changes **6 files changed** (+726 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `.dockerignore` (+1 -1) 📝 `src/core/src/platforms/linux/uinput/joypad.cpp` (+229 -15) 📝 `src/moonlight-server/control/input_handler.cpp` (+81 -27) 📝 `src/moonlight-server/runners/docker.cpp` (+40 -10) 📝 `src/moonlight-server/state/serialised_config.hpp` (+2 -0) 📝 `tests/platforms/linux/uhid.cpp` (+373 -1) </details> ### 📄 Description ## Summary Adds full Nintendo Switch Pro Controller support, enabling: - Gyroscope and accelerometer motion forwarding (requests motion events from Moonlight for Nintendo controller types, same as already done for PS5) - Proper Pro Controller identity with Bluetooth bus, stable MAC-based UNIQ, and correct VID/PID so hid-nintendo binds and SDL recognizes the device - Only hidraw and IMU evdev nodes are exposed to the container (the evdev joystick node is skipped to prevent SDL from creating a duplicate controller via both HIDAPI and evdev paths) - Face button remapping (A↔B, X↔Y) via a `translate_buttons()` helper to compensate for SDL HIDAPI's Nintendo→Xbox remap on read - Tests covering Switch metadata consistency, reconnect plug/unplug, and replayed Moonlight packet ranges ## Dependencies Requires the inputtino Switch Pro UHID backend: games-on-whales/inputtino#37 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 13:00:32 +00:00
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#433
No description provided.