bevy icon indicating copy to clipboard operation
bevy copied to clipboard

DualSense Adaptive Triggers Support

Open Bcompartment opened this issue 8 months ago • 3 comments

What solution would you like?

Adaptive triggers (L2/R2 resistance control) for DualSense, without external apps.

Additional context

https://github.com/godotengine/godot-proposals/issues/12087

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

Bcompartment avatar May 23 '25 08:05 Bcompartment

This might be better implemented in gilrs, the input library bevy uses. I don't think it has an open issue about this. Alternatively steamworks-sys provides a function called SetDualSenseTriggerEffect that you could use, but that is not available in the steamworks crate by the same authors nor in bevy-steamworks I think.

The only alternative I could see is directly interfacing with hidraw which could be interesting, but for a third-party crate. For anyone interested in this, I have an old project you could take inspiration from on gitlab. Though there might be better options out there now.

TygoKooistra avatar May 23 '25 09:05 TygoKooistra

steamworks-sys

Actually if you or anyone else end up going this route, it looks like ScePadTriggerEffectParam cannot be constructed in the rust bindings, and the relevant constants are not available either. So you will have to look at the steamworks C headers and do some rather unsafe code to allocate the memory. Here is an example of the C api: partner.steamgames.com. I fear I might be steering off-topic though, since this solution is unrelated to bevy.

TygoKooistra avatar May 23 '25 10:05 TygoKooistra

It would be nice to support this, but it's fundamentally a gilrs problem.

alice-i-cecile avatar Jun 02 '25 18:06 alice-i-cecile