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

Xinput triggers mapped to analog sticks could pollute internal analog sticks state #18404

Closed
2 tasks done
Kethen opened this issue Nov 10, 2023 · 2 comments
Closed
2 tasks done
Labels
Input/Controller Input and controller issues
Milestone

Comments

@Kethen
Copy link
Contributor

Kethen commented Nov 10, 2023

Game or games this happens in

all games, if triggers were mapped under xinput

What area of the game / PPSSPP

It seems that Xinput devices would not send trigger values unless it's over XINPUT_GAMEPAD_TRIGGER_THRESHOLD

if (NormalizedDeadzoneDiffers(prevState[pad].Gamepad.bLeftTrigger, state.Gamepad.bLeftTrigger, XINPUT_GAMEPAD_TRIGGER_THRESHOLD)) {

So it never sends anything under XINPUT_GAMEPAD_TRIGGER_THRESHOLD after a higher value was sent, leaving a stuck analog value > 30.f/255.0f ~ 0.1176 on internal state

The stuck value can then further affect analog normalizing on control mapper

What should happen

Idle trigger should not maintain an analog value

Maintaining a value could also be the cause of #16643

Perhaps when XINPUT_GAMEPAD_TRIGGER_THRESHOLD is not met, it should gradually send values until 0 so that control mapper can also drop back to under deadzone? Or maybe send clamp((x - 30.0f)/(255.0f - 30.0f), 0.0, 1.0) as trigger input and skip the check

Logs

No response

Platform

Windows

Mobile phone model or graphics card

Not relevant

PPSSPP version affected

v1.16.6 release, v1.16.6-290-g2036f1c36

Last working version

No response

Graphics backend (3D API)

Vulkan

Checklist

@Kethen
Copy link
Contributor Author

Kethen commented Nov 11, 2023

Since 633a6f6, it might make sense to just skip the deadzone checking for triggers as well

Kethen added a commit to Kethen/RemasteredControls_GTpsp that referenced this issue Nov 11, 2023
Assume hrydgard/ppsspp#18404 is fixed, it
would improve car control. Note that it is not an issue on non
windows build.
@hrydgard hrydgard added this to the v1.17.0 milestone Nov 11, 2023
@hrydgard hrydgard added the Input/Controller Input and controller issues label Nov 11, 2023
@hrydgard
Copy link
Owner

Fixed by #18407.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Input/Controller Input and controller issues
Projects
None yet
Development

No branches or pull requests

2 participants