godot icon indicating copy to clipboard operation
godot copied to clipboard

Xbox Controller detected as two devices

Open FarbrorMartin opened this issue 3 years ago • 2 comments

Godot version

3.5 RC4

System information

Windows 10, GLES3, Intel HD 620

Issue description

Xbox Wireless Controller gets detected as two controllers.

I detect connected controllers with Input, like so: var joypads = Input.get_connected_joypads() If I connect an Xbox Wireless controller i get two entries. One for an XInput Gamepad, and one for an Xbox Series Controller. They both give input actions from the physical controller.

In a local multiplayer game this causes problems because one controller gets interpreted as two players, and thus the same physical controller controls two characters.

I have not hade this problem with my wired Xbox clone controller, my wireless 8Bitdo or my wired Xbox 360 clone controller.

Steps to reproduce

Connect an Xbox Wireless Controller (or maybe a wired, though I have not tested this). Get a list of connected controllers using Input.get_connected_joypads() See that the list contains two entries, instead of the expected one entry.

Minimal reproduction project

Xbox Controller detected twice.zip

FarbrorMartin avatar Nov 27 '22 14:11 FarbrorMartin

I tested the same controller on the Gamepad Tester website, and it does not register as two devices there, but instead as a single "Xbox 360 Controller (XInput STANDARD GAMEPAD)"

FarbrorMartin avatar Nov 27 '22 14:11 FarbrorMartin

Just tested on 4.0 beta 6 and the problem is the same.

FarbrorMartin avatar Nov 27 '22 14:11 FarbrorMartin

I can confirm I'm having this issue in 4.0 beta 11

MicrotonalMatt avatar Jan 13 '23 11:01 MicrotonalMatt

If I connect an Xbox Wireless controller i get two entries.

Are you using an USB adapter or Bluetooth for the wireless connection? Same question for @MicrotonalMatt :slightly_smiling_face:

Calinou avatar Jan 13 '23 17:01 Calinou

The controller was connected to the computer via USB cable but was sending inputs via bluetooth. I just found that switching the usb port fixed the issue for me but I'm still not sure of the cause.

MicrotonalMatt avatar Jan 13 '23 22:01 MicrotonalMatt

The controller was connected to the computer via USB cable but was sending inputs via bluetooth. I just found that switching the usb port fixed the issue for me but I'm still not sure of the cause.

This was likely the culprit. I'm not sure if we can do anything about it. How do other engines behave in this situation?

@FarbrorMartin Can you check whether you were had the controller connected via USB while using it via Bluetooth?

Calinou avatar Jan 13 '23 22:01 Calinou

I’m sorry but I returned the controller, and I don’t have another one like it. (It had some connection issues where it constantly lost BT-connection) It was a Xbox wireless, so I assume I connected it via Bluetooth. If I remember correctly it worked as it should when I tested it on that js-based web page. Can’t remember the name right now. It’s for testing controllers. I think that one is based off the same libraries as Godot’s controller code. SDL? Maybe you could test that and see if it works?

On Fri, 13 Jan 2023 at 23:24, Hugo Locurcio @.***> wrote:

The controller was connected to the computer via USB cable but was sending inputs via bluetooth. I just found that switching the usb port fixed the issue for me but I'm still not sure of the cause.

This was likely the culprit, and I'm not sure if we can do anything about it.

@FarbrorMartin https://github.com/FarbrorMartin Can you check whether you were had the controller connected via USB while using it via Bluetooth?

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/69257#issuecomment-1382460539, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZHL64UN3RYTPPQOTKZKPLWSHI3HANCNFSM6AAAAAASMRHWSA . You are receiving this because you were mentioned.Message ID: @.***>

FarbrorMartin avatar Jan 13 '23 22:01 FarbrorMartin

I tested the controller with both usb ports on gampad-tester.com and both times it detected the controller as xinput with index 0.

MicrotonalMatt avatar Jan 13 '23 22:01 MicrotonalMatt

I have the same issue in 4.0 beta 12, but only when the controller is in Bluetooth mode. Hooking up the controller with a USB-C cable fixes the issue for me. When wireless, it registers as XInput Gamepad and Xbox Series Controller. When connected via cable, it only registers as XInput Gamepad.

Edit: I tested in the gamepad tester website, and it detected it as a single controller. This seems like a Godot issue.

PrecisionRender avatar Jan 20 '23 21:01 PrecisionRender

Note: This seems like a duplicate of #41684.

PrecisionRender avatar Jan 20 '23 22:01 PrecisionRender

Duplicate of https://github.com/godotengine/godot/issues/41684.

Calinou avatar Jan 20 '23 23:01 Calinou