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

[platforms/glfw] fix: GetGamepadButtonPressed() can return analog trigger button values #4742

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

whaleymar
Copy link
Contributor

Currently GetGamepadButtonPressed() cannot return GAMEPAD_BUTTON_LEFT_TRIGGER_2 or GAMEPAD_BUTTON_RIGHT_TRIGGER_2 when using GLFW for input because GLFW treats them as analog values. When their analog value exceeds 0.1, Raylib sets the binary button state to 1 but doesn't update lastButtonPressed. This is probably an oversight, so I've fixed that in this PR.

…AD_BUTTON_LEFT_TRIGGER_2 / GAME_PAD_BUTTON_RIGHT_TRIGGER_2 if they are pressed
@raysan5 raysan5 merged commit e85ae86 into raysan5:master Feb 1, 2025
@raysan5
Copy link
Owner

raysan5 commented Feb 1, 2025

@whaleymar Good catch! Thanks for the review!

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

Successfully merging this pull request may close these issues.

2 participants