How do I get input_handles in SteamGodot?

Godot Version

4.2

Question

I’m trying to implement Steam Input in my game and most GodotSteam functions require an input_handle parameter, but I can’t find how to get one.

I tried getConnectedControllers() which returns an empty array and getControllerForGamepadIndex() which returns 0.

Look at get joy guid (globally unique identifier) I think this is what the steam input_handle wants.

It requires a device number you can get that by calling Input.get_connected_joypads()

It also returns 0

Then your input device may not be in SDL2 database, that input_handle is just a number, and zero is a number.

Did it return a string “default gamepad” like the description says?

No, it says __XINPUT_DEVICE__

After switching my gamepad to DirectInput mode get_joy_guid() returns 030000006d04000016c2000000000000 but that’s not an int and thus not accepted as input_handle.

Which gamepad do you have exactly?

How does a web browser recognize your gamepad? Google Chrome even supports my old Xbox controller via USB without installing drivers on my MacMini. (Godot can’t do that yet)

I have a Logitech F310, both Chrome and Firefox detect it.

Also in Godot is_joy_known() returns true but only in XInput mode.

ok

GodotSteam uses GetConnectedControllers it’s a different interface (I think), you have to look at the Steam documentation

https://partner.steamgames.com/doc/features/steam_controller/getting_started_for_devs

Never mind, found the problem myself. I just needed to use runFrame()

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.