Skip to content

Android scan code and description implementations#3618

Merged
eXpl0it3r merged 4 commits intoSFML:masterfrom
JonnyPtn:android_scancode
Dec 3, 2025
Merged

Android scan code and description implementations#3618
eXpl0it3r merged 4 commits intoSFML:masterfrom
JonnyPtn:android_scancode

Conversation

@JonnyPtn
Copy link
Copy Markdown
Contributor

@JonnyPtn JonnyPtn commented Dec 3, 2025

Description

Currently scancode is always 0 on 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

  • Tested on Android

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

@github-project-automation github-project-automation Bot moved this to Planned in SFML 3.1.0 Dec 3, 2025
@eXpl0it3r eXpl0it3r added this to the 3.1 milestone Dec 3, 2025
@eXpl0it3r eXpl0it3r moved this from Planned to In Review in SFML 3.1.0 Dec 3, 2025
Comment thread src/SFML/Window/Android/WindowImplAndroid.cpp
Comment thread src/SFML/Window/Android/InputImpl.cpp Outdated
@eXpl0it3r eXpl0it3r merged commit ca65abe into SFML:master Dec 3, 2025
104 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in SFML 3.1.0 Dec 3, 2025
@JonnyPtn JonnyPtn deleted the android_scancode branch December 3, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants