[core] Fix some mouse issues on SDL
#3428
Merged
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.
Fixes
Fixes the mouse wheel getting stucked scrolling up or down by adding the missing reset (R534-R536).
Fixes the mouse sensitivity being really high on 3D by adding the missing previous mouse position registry (R538-R539).
Fixes the mouse button presses not working properly by adding the missing previous mouse button registry (R561-R562) and by adding handling for
SDL_MOUSEBUTTONUP
(R619-R622)..
VERY IMPORTANT NOTE: @raysan5
The
SDL2
mouse button order isLEFT, MIDDLE, RIGHT, ...
(doc), but we currently useLEFT, RIGHT, MIDDLE, ...
(L674-L676), so, when the migration toSDL2
is complete, thatMouseButton enum
onraylib.h
needs to be adjusted. Until then, the middle and right mouse binds will be inverted.Reference
Items 1, 2, 6 of #3313 (comment).
Environment
Tested this changes successfully on Linux (Ubuntu 22.04 64-bit, gcc 11.2.0) with SDL2 (2.28.4).
Edits
1: added line marks.
2: added another fix, environment, formatting.
3: added another fix.