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 SDL keyboard issue #3435

Merged
merged 2 commits into from
Oct 17, 2023
Merged

Fix SDL keyboard issue #3435

merged 2 commits into from
Oct 17, 2023

Conversation

Bigfoot71
Copy link
Contributor

As originally mentioned by @ubkp in the issue [core] Splitting rcore by platform into submodules, here is the fix for the keyboard handling issue with SDL.

This modification includes a mapping table between SDL scancodes and raylib keys, along with a function to safely retrieve them.

I've also revised the state change of CORE.Window.shouldClose by using CORE.Input.Keyboard.exitKey instead of SDLK_ESCAPE directly, but as indicated in the comment, I believe this part would be better placed outside of the switch statement.

We have added a mapping table between raylib keys and SDL scancodes.
@ghost
Copy link

ghost commented Oct 17, 2023

Tested successfully on Linux (Ubuntu 22.04 64-bit, gcc 11.2.0) with SDL2 (2.28.4). Great job!

@raysan5 raysan5 merged commit 80432fd into raysan5:master Oct 17, 2023
12 checks passed
@raysan5
Copy link
Owner

raysan5 commented Oct 17, 2023

@Bigfoot71 Nice! Thanks for the improvement!

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