mirror of
https://github.com/games-on-whales/wolf.git
synced 2026-10-15 13:02:03 +00:00
[PR #442] [MERGED] feat: better control over motion joypads #470
Labels
No labels
🧠 1 - 🤖 999
AMD
bug
bug
cannot reproduce
documentation
duplicate
easy
enhancement
enhancement
enhancement
fixed?
fixed?
good first issue
hard
help wanted
Intel
invalid
LXC
medium
moonlight-protocol
Multi GPU
nixos
not a bug
nvidia
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/wolf#470
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/wolf/pull/442
Author: @kmreisi
Created: 6/22/2026
Status: ✅ Merged
Merged: 6/23/2026
Merged by: @ABeltramo
Base:
stable← Head:fix/upgrade-unknown-with-gyro-to-ps📝 Commits (3)
4ebbd98feat: auto-promote UNKNOWN-with-motion clients to PS + motion_controller_override39a317flint: clang-format3ab6360fix: updated failing test📊 Changes
6 files changed (+86 additions, -15 deletions)
View changed files
📝
docs/modules/user/pages/configuration.adoc(+31 -0)📝
src/moonlight-server/api/api.hpp(+1 -0)📝
src/moonlight-server/api/endpoints.cpp(+5 -1)📝
src/moonlight-server/control/input_handler.cpp(+37 -13)📝
src/moonlight-server/state/serialised_config.hpp(+10 -0)📝
tests/testWolfAPI.cpp(+2 -1)📄 Description
Problem
Wolf trusts the controller type the Moonlight client reports. For phone clients that's often wrong:
moonlight-common-c(used by all Moonlight clients) advertisesGYRO/ACCELEROMETERcapability whenever the phone has sensors enabled, but Moonlight Android specifically downgrades the reported type toUNKNOWNwhenever the phone has sensors and the underlying pad isn't already a DualSense:Wolf's default for UNKNOWN is the Xbox virtual pad. The motion-request blocks (
if (capabilities & GYRO|ACCELEROMETER && final_type == PS)) only fire for PS pads — so the gyro/accel data the client is ready to send is silently dropped.Fix
Two related changes, bundled:
1. Auto-detect (always on, no config)
When the client reports
controller_type=UNKNOWNAND advertisesGYROorACCELEROMETER, Wolf creates a PS5/DualSense pad instead of falling through to Xbox. The motion blocks then fire and the gyro data is forwarded end-to-end. Stock Moonlight Android with any non-PS pad on any phone with sensors enabled now gets motion routed out of the box.The promotion is unconditional because Moonlight Android itself shows an in-game toast ("Gamepad type may be changed due to motion sensor emulation") when the user enables motion — the client-side already signals the type change is expected.
2. Per-client
motion_controller_overridesettingA new optional
motion_controller_override: ControllerTypefield onClientSettings(defaultAUTO). Sibling ofcontrollers_override: same shape of "operator wants type X" but gated on the client actually having motion to forward. Whencontrollers_override[slot]is unset, the client advertisesGYRO/ACCELEROMETER, ANDmotion_controller_override != AUTO, Wolf forces that pad type instead of the auto-detected one.Same plumbing as
controllers_override— added toPartialClientSettings, threaded through both the lobby-create and client-settings-update endpoints.Useful for "every motion-capable connection from this client should land on device X" preferences. Forward-compatible with PR #385's Switch Pro work — once those motion-gates extend beyond
PS,motion_controller_override = "NINTENDO"will route motion to a Switch Pro pad.Precedence
Compatibility
Existing clients with
motion_controller_overrideunset keep their behaviour for explicit XBOX/PS/NINTENDO. The only behaviour change is for UNKNOWN-with-motion clients, which previously got Xbox+no-motion and now get DualSense+motion — universally an improvement for the affected users (everyone on Moonlight Android with a non-DS pad + sensors enabled).Documented
In
docs/modules/user/pages/configuration.adocunder "Override the default joypad mapping" — two new sub-sections covering the auto-detection andmotion_controller_override.Verified
End-to-end on a Pixel 7 running stock Moonlight Android with an Xbox pad attached: client reports UNKNOWN with
GYRO|ACCELEROMETER, Wolf creates a DualSense, and gyro/accel events arrive at the virtual pad — no config needed. Withmotion_controller_override="XBOX"set on the same client, Wolf creates an Xbox pad instead.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.