How to implement PS5 L2 and R2?

Godot Version

float L2_pressure = Input.GetActionStrength(“HorizontalSqueeze”); //lnput map names
float R2_pressure = Input.GetActionStrength(“VerticalSqueeze”);
if (L2_pressure != 0)
{
GD.Print("L2 pressure: " + L2_pressure);
}
else if (R2_pressure != 0)
{
GD.Print("R2 pressure: " + R2_pressure);
}

Question

After a while doing research, I just found out that I can implement them with the input map, but the internet isn’t helping anymore. Basically, how to use the controller’s sensitivity on each trigger (how to make it more difficult to press or block it completely)? I know that they range from 0 to 1 and I want to make it harder to press the closer it is to 1 (by the way, the print isn’t showing if am barely pressing the buttons… I was expecting to get a value of 0.00something, but nothing happened… is this normal?)

yes it’s called a dead zone. Analog inputs will have a noise that the dead zone will hide. I think this can be modified in the input map project settings for each action.

Do you mean change the force feedback on the PS5 controller? If yes, this functionality isn’t built into Godot. You would need a 3rd party extension (if it exists).

There’s a pull request implementing DualSense adaptive triggers support on macOS: [macOS/iOS] Controller motion, adaptive triggers and touchpad support. by bruvzg · Pull Request #88590 · godotengine/godot · GitHub

Windows and Linux will require separate implementations. Also, note that it’ll require using the controller in wired mode to work (it can’t work in Bluetooth on PC).

Am using windows and I know it only works wired, but if there isn’t a way of handling this… how would I code it?

Thanks a lot for your reply. I didn’t know the dead zone thing. Makes sense. At any case, how could I get this force feedback, either by coding it myself or, most likely, by asking for this feature? (Am new to Godot, sorry if it’s a dumb question)

It’s not implemented in the engine yet, so I’m afraid you can’t use adaptive triggers in your project for now.

Implementing new controller features requires low-level OS-specific code which can’t be done via scripting.

What should I do, then, for Godot to implement this? Who should I speak to? Where should I ask this feature? Basically, what needs to be done in order to get it? (…And how long does it take?)

It could be months before we see something.

This app has a very round-about way to interface with a PS5 controller. It can work via localhost UDP packets, or a text file. Godot could do both but it will take some upfront effort to make an interface.

But it won’t be very portable.

Anyway I found this info on Reddit.

https://www.pcgamingwiki.com/wiki/Controller:DualSense