Android scan code and description implementations#3618
Merged
eXpl0it3r merged 4 commits intoSFML:masterfrom Dec 3, 2025
Merged
Android scan code and description implementations#3618eXpl0it3r merged 4 commits intoSFML:masterfrom
eXpl0it3r merged 4 commits intoSFML:masterfrom
Conversation
eXpl0it3r
reviewed
Dec 3, 2025
eXpl0it3r
reviewed
Dec 3, 2025
eXpl0it3r
approved these changes
Dec 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Currently scancode is always
0on android, as it was (rightly) not prioritised to hold up the scan code feature. Scancodes are a bit funny on android (what isn't?!) as they are not necessarily consistent and can be controlled by layout files. For this implementation I've used androids provided "generic" layout to generate the mapping.For the description, it seems like it might be possible to do it via a jni call if we construct an android input event from the scancode and pass that over, but the input event struct implementation is hidden and I can't work out how to manually construct it, so for now I have just put in a basic direct mapping from scancode to string
Tasks
How to test this PR?
Simplest way is to rebase this on to #3613 then open the project and run the events example either using the emulator with keyboard passthrough or a real device with a real keyboard attached