gamepad.js
gamepad.js copied to clipboard
Wrong mapping in Firefox
Firefox has a different button mapping. The button_1, button_2 and button_3 are switched.
Chrome, Opera and Edge: button_1 => X button button_2 => circle button button_3 => square button
Firefox: button_1 => square button button_2 => X button button_3 => circle button
Tested using a PS4 Controller.
PS: The site gamepadviewer.com displays the input correctly.
Thats odd. I'll give that a try later.
As of right now this library doesn't use browser detection. It worked consistently across all of the browsers I tested with when I first built it. That would be a bummer to have to add that.
Thank you for the report!
This is a Firefox bug on macos. It works correctly on Windows version of Firefox