Input.get_joy_guid(0) not returning valid GUID

Godot Version

4.2.1

Question

Trying to implement input re-mapping in my game. I have been searching on this issue for a couple hours, haven’t gotten anywhere.

To be clear: the controller I am using actually works in game - all my mappings are fine. And even in-game re-mapping is fine. But I need to get the joypad type to be able to show meaningful names (as opposed to InputMap.action_get_events(action)[ind].as_text()) which is a long string containing every possible mapping name for the button).

I have an Xbox One controller connected via a USB cable.

I’m calling this code to test:

	print(Input.get_connected_joypads())
	print(Input.get_joy_guid(0))

I get this as output:

[0]
__XINPUT_DEVICE__

I am expecting to see one of these GUIDs, for an Xbox One controller (based on SDL2 SDL_GameControllerDB/gamecontrollerdb.txt at master · mdqinc/SDL_GameControllerDB · GitHub)

Testing is fine Hardware Tester

Any ideas?

Edit: upon reflection… I’m realizing my controller is being brought in as an xbox 360 controller. Same issue stands though, still should be getting a GUID

I had the same expectation and result regarding Input.get_joy_guid(). Not sure why it masks the guid like that.

Input.get_joy_info() will at least give you the vendor_id, which may be helpful in lookup.

You’re getting __XINPUT_DEVICE__ because (if I read the docs right) that’s how it’s being reported by the OS. Theoretically, every xinput device has a (clickable) left and right stick, two shoulder bumpers, two shoulder triggers, a dpad, an abxy button cluster, start and select. They’re all supposed to be “the same”, or close enough that you can refer to the “A button” or “LB” and have it be obvious what you mean.

How well that’s worked out in reality is left as an exercise to the reader, but that’s how it’s supposed to work.