greggman / html5-gamepad-test

Home Page:https://greggman.github.io/html5-gamepad-test/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Only the first to axes pairs have the display number updated

Lazerbeak12345 opened this issue · comments

I'm aware this might not be easy to test, but this shows up with gamepads on windows with nine or so stick axes (as compared to the usual 4)

This is a layout common to PS3 style controllers when plugged into windows (in my experience most controllers that are less than 10USD are this layout). FYI, the last axes (axel?) is the 8 direction D-pad, and that's how you can tell (up is 1, then clockwise around to up left is -1).

Love the tester btw.

I plugged in a PS3 controller to my windows machine. I couldn't repo in the issue. Tried both Firefox and Chrome (Firefox on top)

qgRKyXQnVU

I also tried Firefox, Safari, and Chrome on MacOS, same PS3 controller.

ScreenFlow

I did notice that Safari is missing the 17th button (you can report a bug at https://bugs.webkit.org if you want). I also noticed pressing the "Share" button on the controller while in Safari (button 8) would prompt to allow Safari to share the screen. Which makes no sense. Safari also didn't respond well to reading button 8 (probably because it was doing something related to screen sharing)

In any case, the code is just looping through the outputs of the API and reporting it. It has no knowledge of what kind of controller you've plugged in. If the browser says here are 28 axes and 37 buttons it will show 28 axes and 37 buttons. If the API says a button always reports -1 or +1 it will show that +1 or -1

If you're having issues with controllers that probably means a browser bug or a driver bug

Doh! I finally understood the issue being reported. 😅

Fixed

4bb1df1

Awesome! That did the job!