Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L2/R2 input threshold adjustment #526

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kh0nsu
Copy link
Contributor

@kh0nsu kh0nsu commented Aug 22, 2024

  • Input threshold changed to 150 (pressed) 135 (released) >31 <16
  • Fixes L2/R2 sticking where the rest point is 127 slightly above 0
  • Avoids glitches when only partially pressed or drifting
  • Still compatible with 0/255 inputs from keyboard (and now controller obviously)
  • Tested with xbox controller and keyboard
  • TRACE logging to help with threshold tuning; shouldn't compile in on release builds

@georgemoralis
Copy link
Collaborator

Looking nice and someone test if that solves the l2/r2 issues?

@SuperPlasmaPanda
Copy link

SuperPlasmaPanda commented Aug 22, 2024

Doesn't seem to work in DSR
edit: on Dualsense

@efigr
Copy link

efigr commented Aug 22, 2024

Doesn't seem to make any difference on RE4 (2005), and Dark Souls Remastered.
I've also made a custom build to test it on Bloodborne, no difference there either.

Using an Xbox Series controller, if that matters.

@bigol83
Copy link
Contributor

bigol83 commented Aug 22, 2024

Doesn't seem to make any difference on RE4 (2005), and Dark Souls Remastered. I've also made a custom build to test it on Bloodborne, no difference there either.

Using an Xbox Series controller, if that matters.

Same for me with DS4, doesn't fix the issue in Dark Souls remastered

@kh0nsu
Copy link
Contributor Author

kh0nsu commented Aug 22, 2024

Very curious what's going on if this still doesn't fix it for everyone. Try enabling the logging (maybe change them to LOG_DEBUG or higher so you don't need all the trace stuff compiled in). That should show the range of values then; if it's not going above 150 or below 135 then the thresholds need adjusting. If the messages stop appearing after the first press or if it varies between games then something else is going on.

@efigr
Copy link

efigr commented Aug 22, 2024

Very curious what's going on if this still doesn't fix it for everyone. Try enabling the logging (maybe change them to LOG_DEBUG or higher so you don't need all the trace stuff compiled in). That should show the range of values then; if it's not going above 150 or below 135 then the thresholds need adjusting. If the messages stop appearing after the first press or if it varies between games then something else is going on.

Gonna look into it.

@georgemoralis
Copy link
Collaborator

#531 solves l2/r2 issue . Since I don't have a gamepad I dunno if that pr is needed now

@kh0nsu
Copy link
Contributor Author

kh0nsu commented Aug 23, 2024

#531 solves l2/r2 issue . Since I don't have a gamepad I dunno if that pr is needed now

Oh, great! So the axis gets 0 to 255 then? I still recommend a non-zero threshold for the digital buttons in case there are games using that (it seems the above games prefer the analog value?) to deal with axis drift.

j added 2 commits August 23, 2024 15:13
…ove 127. This should fix the "only works once" issue and also avoid glitches. Tested with xbox controller and keyboard. Add TRACE-level logging for this.
@kh0nsu kh0nsu changed the title L2/R2 input threshold "only works once" fix L2/R2 input threshold adjustment Aug 23, 2024
@kh0nsu
Copy link
Contributor Author

kh0nsu commented Aug 23, 2024

Rebased to after #531, updated and tested the thresholds with the corrected scaling.

@Hermiten
Copy link
Collaborator

Hermiten commented Sep 9, 2024

Can someone test it ? :)

@rafael-57
Copy link

Can someone test it ? :)
@Hermiten can you pls bring your branch up to date with main? I'll test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants