hajimehoshi / ebiten

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

Joy-Con L and R are recognized as two gamepads on Windows, and all buttons never work #3127

Open bin16 opened 2 weeks ago

bin16 commented 2 weeks ago

Ebitengine Version

github.com/hajimehoshi/ebiten/v2 v2.8.1

Operating System

Go Version (go version)

go version go1.22.5 windows/amd64

What steps will reproduce the problem?

  1. Connect Joy Con L and R to Windows (my is Windows 11)
  2. Open a terminal, and run go run github.com/hajimehoshi/ebiten/v2/examples/gamepad@latest
  3. See the window, and test buttons.

图片

What is the expected result?

Chrome

Gamdpad Tester

What happens instead?

Anything else you feel useful to add?

bin16 commented 2 weeks ago

On macOS, it's a bit different on Chrome. macOS 14.4.1 (23E224)

Gamepad example, macOS

Running from terminal is same, Joy-Con L and Joy-Con R

图片 图片

Gamepad example, Chrome on macOS

Running from Chrome, it's two gamepads, but Joy-Con L/R and Joy-Con L+R, and when press buttons, the two gamepads are triggered, button different buttons.

Chrome on macOS, no button pressed:

图片

Chrome on macOS, and Button (X) is pressed, (X) is right top button:

图片

Gamepad Tester, Chrome on macOS

Joy-Con L/R, Chrome on macOS, Gamepad Tester, button (X) pressed.

图片

Joy-Con L+R, Chrome on macOS, Gamepad Tester, button (X) pressed.

图片

https://hardwaretester.com/gamepad

hajimehoshi commented 2 weeks ago

Thank you for reporting. This seems pretty tricky and I am not sure I can fix ths.

bin16 commented 2 weeks ago

Joy-Con on Chrome on macOS is wild, but not a problem of ebiten i think, browser and macOS should fix that, may be i should upgrade to macOS 15 to test that.

So, the question is, Joy-Con L and Joy-Con R are taken as two gamepad but not one, both on Windows and macOS. (and buttons never work) I have no Linux device to test if it will be different.

hajimehoshi commented 2 weeks ago

So, the question is, Joy-Con L and Joy-Con R are taken as two gamepad but not one, both on Windows and macOS. (and buttons never work)

As long as an OS recognizes them as a separate gamepads, there is nothing Ebitengine can do unfortunately. I am not sure what happens with buttons.

Browsers have special care about gamepads and as far as I understand. They implement special drivers for some famous gamepads.

bin16 commented 2 weeks ago

As long as an OS recognizes them as a separate gamepads, there is nothing Ebitengine can do unfortunately. I am not sure what happens with buttons.

Browsers have special care about gamepads and as far as I understand. They implement special drivers for some famous gamepads.

Thanks for your reply. It would be very helpful if buttons can work, even two gamepads.

bin16 commented 2 weeks ago

Never mind, Godot never recognize buttons too.