Skip to content

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

Merged
raysan5 merged 1 commit intoraysan5:masterfrom
whaleymar:glfw_lastbutton
Feb 1, 2025
Merged

[platforms/glfw] fix: GetGamepadButtonPressed() can return analog trigger button values#4742
raysan5 merged 1 commit intoraysan5:masterfrom
whaleymar:glfw_lastbutton

Conversation

@whaleymar
Copy link
Copy Markdown
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
Copy Markdown
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