moonlight-stream / moonlight-ios

GameStream client for iOS/tvOS
GNU General Public License v3.0
1.16k stars 293 forks source link

Enable client-side button remapping on iOS Moonlight client #511

Open IonBlade2K opened 2 years ago

IonBlade2K commented 2 years ago

Is your feature request related to a problem? Please describe. iOS/iPadOS 16 support Nintendo Switch Joy-Cons. However, the iOS button mapping is setup in a way that swaps A and B, X and Y:

Joy-Con Input -> iOS button Output / Moonlight Xbox Controller Output A (right face button) -> A (bottom face button) B (bottom face button) -> B (right face button) X (top face button) -> X (left face button) Y (left face button) -> Y (top face button)

Unfortunately, the native Joy-Con combining does not support iOS's native controller profile behavior for button remapping, so the buttons cannot be remapped at the input level in the OS. While they can be remapped in Steam on the remote side, some games, like Destiny 2, do not support Steam's button remapping as an anti-cheat measure, so global remapping at the PC side also isn't an option.

It seems as if Apple intends for this to be the behavior of Joy-Cons in iOS/iPadOS 16 - they want the button with "A" written on it to send "A" as output, even if that's not the same physical location button on Xbox controllers, and intend for developers of apps to enable remapping to the proper output button if that functionality is needed, meaning this would have to be fixed either client-side in Moonlight or remapped PC-side (which not all games support).

Describe the solution you'd like A clean global fix to this would be to enable button remapping within the Moonlight iOS client.

While a full client-side remapping option would be great, an easier fix for the specific Joy-Con issue would be a toggle in Moonlight to simply swap A<->B and X<->Y, so that input A sends B, B sends A, X sends Y, and Y sends X.

This would enable Switch Joy-Cons to have the proper output to PC in iOS 16 that match the equivalent physical button presses on an Xbox controller, without having to rely on PC-side remaps per game, which not all games support.

Describe alternatives you've considered

Additional context Here's a video of the behavior of 2x native first party Joy-Cons in iOS 16, demonstrating how the buttons are swapped from their physical locations, and why an A<->B / X<->Y swap toggle in Moonlight would be important to not have to swap things PC-side per-game (where not all games support remapping or Steam controller profiles, which would be an incomplete solution): https://www.youtube.com/watch?v=HukjfrGM3no

squk commented 2 years ago

It looks like the PR was merged but I don't see this setting on my device.