godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.13k stars 21.19k forks source link

Xbox Wireless Controller in Bluetooth inputs trigger twice on a focused window #41684

Closed pho closed 1 year ago

pho commented 4 years ago

Godot version: 3.2.2-mono

OS/device including version: Windows 10 Pro Version 1909 Xbox One controller via bluetooth

Issue description: A single joypad button press:

There is also a shift in the device index:

See https://gfycat.com/physicalfortunatefinwhale

Steps to reproduce: Check out the attached project, its just a func _input() with a print

Minimal reproduction project: BugReport.zip

KoBeWi commented 3 years ago

Oh I had the same issue, with the same setup: #35903 But it's elusive to reproduce, because I tested with the same controller on another W10 laptop and it didn't happen.

KoBeWi commented 3 years ago

So this started happening to me again, with new XBox Series controller and via cable. Seems not consistent anymore though, sometimes there is one event, sometimes 2. My workaround is checking input inside _process() instead _input() bruh (I'm using actions).

MOSN97 commented 3 years ago

I'm having this same problem in version 3.3.2 using an Xbox Series controller. It's rather problematic since my game is multiplayer played with several controllers. I've done some testing and when the window is focused it seems the first controller counts as both device 0 and 1 and if a new controller is added it will be device 2. However if the game is started while two controllers are connected the first controller will count as 0 and 2 while the second will count as 1 like it's supposed to.

Gongure commented 3 years ago

I'm having the same issue.

tcoxon commented 3 years ago

I seem to get this issue in 3.3.3.stable too. One Xbox Series controller connected shows up as two joypads in the engine: one with name "XInput Gamepad", the other with name "Xbox Series Controller".

Gongure commented 3 years ago

I have found a workaround. Since both controllers are synchronized to the frame, I can simply exclude one when joining, for example.

akien-mga commented 1 year ago

Fixed by #71784, at least for Xbox Series controllers.

If anyone has an Xbox One controller and could check if the bug is solved or not in the next beta (4.0 beta 15), that would be great!

Calinou commented 1 year ago

For future reference: