Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pho opened this issue Sep 1, 2020 · 8 comments · Fixed by #71784
Closed

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

pho opened this issue Sep 1, 2020 · 8 comments · Fixed by #71784

Comments

@pho
Copy link

pho commented Sep 1, 2020

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:

  • triggers one event from input device 0 if the game window doesnt have focus (as expected)
  • but triggers TWO events from devices 0 and 1, when the window is focused

There is also a shift in the device index:

  • With the window unfocused, the controller is device 0
  • With focus, the mouse is device 0 and the controller triggers both 0 and 1

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
Copy link
Member

KoBeWi commented Feb 27, 2021

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
Copy link
Member

KoBeWi commented May 8, 2021

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
Copy link

MOSN97 commented Jun 4, 2021

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
Copy link

Gongure commented Oct 5, 2021

I'm having the same issue.

@tcoxon
Copy link
Contributor

tcoxon commented Oct 13, 2021

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
Copy link

Gongure commented Oct 15, 2021

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

@Calinou Calinou changed the title Controller inputs trigger twice on a focused window Xbox Wireless Controller in Bluetooth inputs trigger twice on a focused window Jan 20, 2023
@akien-mga akien-mga added this to the 4.0 milestone Jan 23, 2023
@akien-mga
Copy link
Member

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
Copy link
Member

Calinou commented Jan 23, 2023

For future reference:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants