Skip to content

PS4 controller connected makes a unusable duplicate index on Linux #50273

Closed
@vladimir-sama

Description

@vladimir-sama

Godot version

3.3.2.stable.official

System information

Garuda Linux, 5.12.12-zen1-1-zen, KDE Dragonized, PS4 Controller

Issue description

So I started a new project, then added a joystick detector

var _unused

func _ready():
	_unused = Input.connect('joy_connection_changed', self, '_joy_changed')
	print(Input.get_connected_joypads())
	print()

func _joy_changed(device : int, connected: int):
	if connected:
		Input.start_joy_vibration(device, 0.50, 0.00, 0.30)
		print(device)
		print(Input.get_joy_guid(device))
		print()

I have 2 PS4 controllers connected by cable to a usb 3.0 hub, to a usb 3.0, output:

[]

0
030000004c050000c405000011810000

1
030000004c050000c405000011810000

2
030000004c050000c405000011810000

3
030000004c050000c405000011810000

I connected both controllers one after the other, and there is duplicate indexes? and if I connect them before starting the project:

[0, 1, 2, 3]

I also tried using the duplicate index as player input, did not work.

Steps to reproduce

extends Node2D

func _ready():
	Input.connect('joy_connection_changed', self, '_joy_changed')
	print(Input.get_connected_joypads())
	print()

func _joy_changed(device : int, connected: int):
	print(device)
	if connected: print(Input.get_joy_guid(device))

Nodes are:

Control
ViewportContainer
Viewport
Node2D (code)

Minimal reproduction project

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions