rpcs3 icon indicating copy to clipboard operation
rpcs3 copied to clipboard

SDL: Add DS3 button pressure

Open Megamouse opened this issue 9 months ago • 10 comments

  • Add DS3 button pressure to SDL pad handler

This seems very hacky, but it's supposedly the only way to make it work. The code changes are inspired by non-existent documentation and some bold PRs in other projects.

NOTE: It won't work on windows, since our CI builds SDL without hidapi support.

Fixes #16824

Megamouse avatar Mar 11 '25 00:03 Megamouse

I know it's still a draft but tried it and thought I'd mention the behavior so far:

  • The controller isn't picked (regardless of bluetooth/wired) unless it was turned on/plugged before booting the emulator or before pressing Pads (meaning that if you pressed pads and it wasn't turned on, even refreshing inside Pads won't make it appear)

  • None of the buttons that should have pressure sensitivity work (again regardless of bluetooth/wired), tried pressing harder too (😂) but there's no input registered.

That's all, really appreciate you working on this, Megamouse 🙂

ItsLaguna avatar Mar 19 '25 04:03 ItsLaguna

This works now! It needs to wait for the next SDL update, but at least it can be tested already.

The SDL implementation is a bit strange, but whatever...

Megamouse avatar Apr 10 '25 19:04 Megamouse

You work fast!

Was going to report earlier that simply pressing was giving no input (but hard pressing did) and in the middle of compressing the video I saw a new push and was glad to see that it works now. However there's still a minor hiccup that can occur while going from regular to full press, check the following vid (this is from the latest commit, starts at 0:04):

https://github.com/user-attachments/assets/2ae49b63-5d3d-4034-a224-36e4e08881a0

I'm just pressing harder / loosening it but never letting go, again something minor but thought I'd report it.

Amazing work Megamouse, thanks again 🙏🏻

ItsLaguna avatar Apr 10 '25 20:04 ItsLaguna

@ItsLaguna can you try again ?

Megamouse avatar Apr 10 '25 20:04 Megamouse

@Megamouse working perfectly now, no more hiccups but comparing between DS3 handler and the current SDL I've noticed you gotta push a bit more than usual.

https://github.com/user-attachments/assets/f1d0e27a-019d-462e-bb91-9f4495691ed7

Here I'm switching between both and as you can see it goes back to the other regular press despite applying the same amount of force to the button.

ItsLaguna avatar Apr 10 '25 21:04 ItsLaguna

I know. but that's just how SDL reports the value... Maybe there's some sort of hidden SDL deadzone applied... idk

Megamouse avatar Apr 10 '25 21:04 Megamouse

Ah that's a shame, hopefully they can sort that out. Leaving that aside, it works great and once again, thanks 🙏🏻

ItsLaguna avatar Apr 10 '25 21:04 ItsLaguna

Turns out I was dropping negative values, which means the whole weaker half of the button press. Should be fine now

Megamouse avatar Apr 10 '25 21:04 Megamouse

Yeah, now it matches 👍🏻

Noticed that upon changing handlers, there's a weird input (R1+Triangle?) but honestly no one is going to be doing that. Just letting you know for the sake of it lmao.

https://github.com/user-attachments/assets/cab14d4a-6ad1-4f36-94e9-4493db3b2b09

ItsLaguna avatar Apr 10 '25 22:04 ItsLaguna

I couldn't reproduce this. Maybe it's specific to mgs. But I can try to take a more thorough look when I have the time.

Megamouse avatar Apr 11 '25 16:04 Megamouse