neogeek / gamepad.js

🎮 Simple customizable event binding for the HTML Gamepad API.
https://trello.com/b/sk4knB7J/gamepadjs
MIT License
105 stars 26 forks source link

Doesn't work properly on some x-box like gamepads and some PS3-like gamepads. #6

Open Lazerbeak12345 opened 5 years ago

Lazerbeak12345 commented 5 years ago

With very thorough testing, I have determined this to be the case, and a plausible way to fix it.

Fixing the PS3-like Gamepads

The reason these don't work (yet) is because of these points:

NOTE: All of these problems in this section are unique to PS3 gamepads - and typically the off-brands. In my experience, it is actually easier for someone looking for a budget gamepad to find a used one of these then any other gamepad.

Symptoms

Here are the symptoms of this:

  1. The last axis is outside of the range of -1 to 1. (See above)
  2. Sometimes, an extra gamepad will appear with vendor of 0000 and product 0000
    • Unreliable

Fixing the x-box like gamepads

The reason these don't work (yet) is because of these points:

NOTE: All of these problems in this section are unique to older x-box gamepads - and typically the off-brands. In my experience, many cheap Nintendo Switch compatibles fit in this category, along with a few other cheap gamepads. These, however, aren't as common as the above.

Symptoms

Here are the symptoms of this:

  1. There are less then 16 buttons.
    • This, unfortunately is also the case for some NES-like gamepads, so we may have a problem there... More testing for other (reliable) symptoms needed.
Lazerbeak12345 commented 5 years ago

FYI, I am and have been working on a patch for some time. The problem is it is a patch for the latest commit on master, and might not work with the new commits in the re-write (see the diff). At the very least, my PR, when I submit it should be useful for documentation of how it might be done in the re-write.

Lazerbeak12345 commented 2 years ago

Btw, this seems to only happen on windows. I've never been able to recreate this erroneous behavior on linux.