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

Fix mouse wheel not working in PLATFORM_RPI or PLATFORM_DRM #3193

Merged
merged 1 commit into from Jul 23, 2023
Merged

Fix mouse wheel not working in PLATFORM_RPI or PLATFORM_DRM #3193

merged 1 commit into from Jul 23, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jul 23, 2023

In the meantime (just to not leave the mouse wheel broken) I think the problem was sharing the same variable for holding both "the event" and "the current" value since they run independently.

GetMouseWheelMove() returns the CORE.Input.currentWheelMove (L3949-L3959). But that is always zeroed by PollInputEvents() (L5065) when it runs on EndDrawing(). So the event.value (L6680) never ends up staying on CORE.Input.currentWheelMove long enough before it gets zeroed. This could be solved by storing the event.value in a new CORE.Input.eventWheelMove (R471, R6682). And, after updating the CORE.Input.currentWheelMove (that is what GetMouseWheelMove() needs), reset the CORE.Input.eventWheelMove instead (L5065-R5067).

Tested the fix successfully for PLATFORM_DRM on Raspberry Pi 3 Model B 1.2 with Raspberry Pi OS (11 Bullseye) 32-bit armhf.

Fix #2660.

Edit: added line marks.

@raysan5 raysan5 merged commit 090b857 into raysan5:master Jul 23, 2023
12 checks passed
@raysan5
Copy link
Owner

raysan5 commented Jul 23, 2023

@ubkp thank you very much for reviewing this issue! As always, a great description of the issue and a great fix! Your contributions to raylib are really appreciated!

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.

[core] Mouse wheel not working in PLATFORM_RPI or PLATFORM_DRM
1 participant