hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
11.06k stars 662 forks source link

ebiten: enable to detect a gamepad type like PlayStation, Xbox, and so on #1949

Open hajimehoshi opened 2 years ago

hajimehoshi commented 2 years ago

Requested by @wasedaigo

Now we can do a similar thing by parsing the gamepad name, but this is very fragile.

silbinarywolf commented 2 years ago

I investigated this a while back and wrote a blog post on it: https://www.silbinarywolf.com/post/189934380218/you-cant-just-query-if-a-controller-is-for-xbox

tldr; Xbox controllers gamepad button positions are fairly stable but Playstation and other gamepad button layouts vary from gamepad to gamepad. So your best bet is using this community sourced database of gamepad names / layouts if you were going to implement something like this.

hajimehoshi commented 2 years ago

Ebiten actually uses the same database. My intention here is to add a more reliable way to detect the gamepad type rather than names.