hajimehoshi / ebiten

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

examples/gamepad: PS4 (Dualshock) bluetooth controller inputs not detected on Windows #2967

Closed Hatchibombotar closed 2 months ago

Hatchibombotar commented 6 months ago

Ebitengine Version

2.7.2

Operating System

Go Version (go version)

go1.22.0 windows/amd64

What steps will reproduce the problem?

What is the expected result?

Button inputs are recognised

What happens instead?

image No other output appears after these lines.

Anything else you feel useful to add?

Using a ps4 dualshock controller, but may not be exclusive to this one. I don't have another one to test with. Windows 11 Home, 23H2 Example works in the web browser

hajimehoshi commented 6 months ago

Which USB or bluetooth was the controller connected? Thanks,

Hatchibombotar commented 6 months ago

It was connected by bluetooth. Just tested now and connecting by USB does work

hajimehoshi commented 6 months ago

OK, this doesn't work only when connecting it via bluetooth. Another question: does this work with Ebitengine v2.6.7?

Hatchibombotar commented 6 months ago

It does not.

hajimehoshi commented 6 months ago

Sure, so this is not a regression. TBH I'm not sure I can fix this, but I'll tackle this tomorrow. Thank you for reporting this!

SolarLune commented 6 months ago

@Hatchibombotar - Hello, just to double-check, did you iterate through other gamepad ID's, just to see if it's reported as ID 1 or 2, by chance?

hajimehoshi commented 6 months ago

I failed to reproduce this issue on my Windows (Parallels):

PS Microsoft.PowerShell.Core\FileSystem::\\Mac\Home\ebiten> go run .\examples\gamepad
2024/04/26 00:29:04 gamepad connected: id: 0, SDL ID: 78696e70757401000000000000000000
2024/04/26 00:29:08 button pressed: id: 0, button: 1
2024/04/26 00:29:08 standard button pressed: id: 0, button: 1
2024/04/26 00:29:08 button pressed: id: 0, button: 0
2024/04/26 00:29:08 standard button pressed: id: 0, button: 0
2024/04/26 00:29:08 button released: id: 0, button: 1
2024/04/26 00:29:08 standard button released: id: 0, button: 1
2024/04/26 00:29:08 button released: id: 0, button: 0
2024/04/26 00:29:08 standard button released: id: 0, button: 0
hajimehoshi commented 6 months ago

Your ID was 030000004c050000c405000000000000 (PS4 Controller) while mine was 78696e70757401000000000000000000 (XInput Gamepad (GLFW)). I'm not 100% sure but upgrading or installing DirectX might resolve the issue.

hajimehoshi commented 3 months ago

Does this still happen with v2.7.8? This might be related to #3046

hajimehoshi commented 2 months ago

Let me close this. Feel free to revisit this when you still have this issue.