Open Bug 1704419 Opened 3 years ago Updated 10 months ago

Nintendo Switch gamepad support

Categories

(Core :: DOM: Device Interfaces, enhancement)

Firefox 87
enhancement

Tracking

()

UNCONFIRMED
Webcompat Priority P3

People

(Reporter: picaune, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0

Steps to reproduce:

I connected an Xbox One S controller, a DualShock 4 controller, and a Nintendo Switch Pro Controller to my PC, http://luser.github.io/gamepadtest/, and exercised all buttons and axes.

Actual results:

XBOX One S controller - Showed up as a standard gamepad, everything was mapped properly.
DualShock 4 controller - Showed up as a standard gamepad, everything was mapped properly.
Nintendo Switch Pro Controller - Showed up as a standard gamepad with one extra button. Standard gamepad buttons 0-11 (face buttons, shoulder buttons and triggers, stick buttons, Back/Start) worked properly. Buttons 12-15 (dpad) and all four axes were completely nonfunctional. Button 16 (Home) showed up as button 12 (dpad up), and nonstandard button 17 (Share) showed up as button 13 (dpad down).

Expected results:

All gamepads should have been recognized as standard gamepads and mapped correctly.

This goes in the Core/DOM: Device Interfaces component.

There is some existing support for Nintendo Switch controllers, including a button remapper for the Pro Controller and both varieties of Joy-Con, but it does not appear to be working properly.

This issue was mentioned briefly in bug #1464940 comment 1, but since its comment zero was about DualShock support it was duplicated to bug #1523351.

The Nintendo Switch Pro Controller has fully-functional mappings in EdgeHTML and Chromium. I don't have a reference for Edge, but the Chrome bug is https://bugs.chromium.org/p/chromium/issues/detail?id=801717.

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Device Interfaces' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → DOM: Device Interfaces
Product: Firefox → Core
Webcompat Priority: --- → P3

This isn't a mapping problem. Nintendo Switch Pro controller is non-standard and requires some initialization logic.

It works in Chromium because they've implemented this https://source.chromium.org/chromium/chromium/src/+/main:device/gamepad/nintendo_controller.h

You need to log in before you can comment on or make changes to this bug.