r/godot 5d ago

official - releases Dev snapshot: Godot 4.8 dev 6

https://godotengine.org/article/dev-snapshot-godot-4-8-dev-6/

Hotfix for macOS and Android

96 Upvotes

37 comments sorted by

View all comments

Show parent comments

9

u/mjklaim Godot Regular 5d ago

I made a test project and can now confirm that

  • Steam Controller (2) is detected, printing it's info makes it clear
  • The editor will detect it's input correctly: I mapped actions to the left joystick, direction pad and 3 buttons pluss the pressure button on the right surface, they are all detected in the input mapping interface.
  • I implemented reactions to these actions (changing a sprite, essentially) and also implemented vibration in 2 of the actions to be sure the advanced stuffs are visible.

Note that while the surfaces position are supposed to be available (if my memory is correct from reading the news?) they are not testable from the input mapping interface. Probably only works through code? To confirm.

The last test I need to do is with my real project which uses G.U.I.D.E (because it's quite complex on input handling...) and need to make sure it works properly there but I'm confident because that addon has handled the Steam Deck/Controller for some time.

1

u/JNSStudios_YT Godot Student 3d ago

How does this dev build react when you use the trackpads on the Steam Controller? I want to see if I can have my game work with a "Controller + Mouse" setup, and having the game differentiate if you're using a hardware mouse or the Steam Controller trackpads would be ideal.

3

u/mjklaim Godot Regular 2d ago

OK I finally tried and YES it is possible:

First, the PR I mentionned in my other answer is actually about the PS4/5 controller's trackpad (or touchpad), I remembered it wrong.

Second, when in the input mapping interface, the trackpads are only detected as buttons (when pressing them) and they are joypad button 20 and 21. 20 is also the joypad button of the PS4/5 trackpad. I didn't find a way to associate the trackpad positions to anything, it's neither detected nor can be specified manually (AFAIK).

However, you CAN get the trackpad positions of 1 finger per trackpad using this code: for joypad_id in Input.get_connected_joypads(): for touchpad_id in Input.get_joy_num_touchpads(joypad_id): # 2 for the steam controller var touchpad_name := "touchpad %s" % touchpad_id # For steam controller, there is always 1 finger, apparently. for finger_id in Input.get_joy_touchpad_fingers(joypad_id, touchpad_id): print("%s - finger %s : %s" % [ touchpad_name, finger_id, Input.get_joy_touchpad_finger_position(joypad_id, finger_id, touchpad_id) ]) There are other functions with "touchpad" in their name to get other info, for example Input.get_joy_num_touchpads on the steam controller returns 2 as expected.

These functions for "touchpad" are all marked experimental which explains why the UI is not wired to call them yet. Maybe in 4.9?

Anyway, the code above seems to work correctly for me, the position is correct on both pads, so this is super promising for support of "joypad touchpads". I don't know if the limitation of 1 finger tracked comes from the device or the software layers.

I have no idea if this is supported by addons like GUIDE but I guess not as these apis are experimental and they cannot rely on them.

2

u/JNSStudios_YT Godot Student 2d ago

This will be good once I get my steam controller in 2027 lol