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

[rcore] Fix IsMouseButtonUp() and add touch events for PLATFORM_DESKTOP_SDL #3610

Merged
merged 2 commits into from Dec 7, 2023
Merged

[rcore] Fix IsMouseButtonUp() and add touch events for PLATFORM_DESKTOP_SDL #3610

merged 2 commits into from Dec 7, 2023

Conversation

ghost
Copy link

@ghost ghost commented Dec 6, 2023

Changes

  1. Fixes IsMouseButtonUp() for PLATFORM_DESKTOP_SDL by adding the missing handling for CORE.Input.Touch.currentTouchState[] on the SDL_MOUSEBUTTONDOWN (R1142) and SDL_MOUSEBUTTONUP (R1156) event cases on PollInputEvents() on platforms/rcore_desktop_sdl.c.

  2. Adds SDL_FINGERDOWN, SDL_FINGERUP and SDL_FINGERMOTION event cases basic handling (R1185-R1208) for PLATFORM_DESKTOP_SDL.
    Note: these cases need to be reviewed on a real touch screen.

Credit

Reference

Environment

  • Tested on Linux (Mint 21.1 64-bit) with SDL2 (2.28.4).

Edits

  • 1: added line marks.
  • 2: updated line marks.

@raysan5 raysan5 merged commit ab9bddb into raysan5:master Dec 7, 2023
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Dec 7, 2023

@ubkp Oh! This is really a good catch! I didn't noticed it! Actually I'm not sure if I ever used IsMouseButtonUp()...

Thank you very much for the review and the further improvement with the SDL events!

@ghost
Copy link
Author

ghost commented Dec 7, 2023

@raysan5 All credits really should go to @Bigfoot71 for finding such a subtle bug. Incredible attention to detail, kudos. 👍

@ghost ghost deleted the fix/sdl-keyuptouch branch December 7, 2023 19:42
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.

1 participant