moonlight-qt icon indicating copy to clipboard operation
moonlight-qt copied to clipboard

Nintendo joypad, swapped A/B and X/Y

Open ABeltramo opened this issue 1 year ago • 0 comments

Describe the bug

Originally reported by @shymian in https://github.com/games-on-whales/wolf/issues/56

I've been fixing up the uinput implementation but it seems that Moonlight-qt is sending swapped inputs for the main buttons via the control channel.

When pressing the B (south button) on the joypad it sends this unencrypted HEX

060222000000001E0C0000001A000000010014000010000000000000000000009C0000

which resolves to press the button 4096 (0x1000) which is A. This obviously results in the wrong pressed button if the backend is correctly emulating a Nintendo pad (since A is the east button). This has also been manually tested here

Same applies for X/Y.

Other Moonlight clients

To be tested...

Moonlight settings (please complete the following information)

All default settings; If we set "Swap A/B and X/Y gamepad buttons" everything will be swapped and will work normally.
This might be intended behaviour (so that pressing south results in A: the south button on an Xbox controller?), but I think it's counterintuitive for a user to have to manually set that.

Client PC details

This has been tested using Pro 2 8BitDo joypad which is correctly detected by the PC as

Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x57e product 0x2009 version 0x8111
Input device name: "Nintendo Switch Pro Controller"

on Linux. We also tested with evtest on the client, which correctly reports BTN_SOUTH when pressing B

ABeltramo avatar Feb 01 '24 15:02 ABeltramo