Fix mouse wheel not working in PLATFORM_RPI or PLATFORM_DRM #3193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theCORE.Input.currentWheelMove
(L3949-L3959). But that is always zeroed byPollInputEvents()
(L5065) when it runs onEndDrawing()
. So theevent.value
(L6680) never ends up staying onCORE.Input.currentWheelMove
long enough before it gets zeroed. This could be solved by storing theevent.value
in a newCORE.Input.eventWheelMove
(R471, R6682). And, after updating theCORE.Input.currentWheelMove
(that is whatGetMouseWheelMove()
needs), reset theCORE.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.