Skip to content

Conversation

@imsys
Copy link
Contributor

@imsys imsys commented Sep 11, 2025

The SDL2 update (86a4cc3) worked great on all plataforms, but on Android that got crashes.

I tried to selective update the file, butt there were a multiline
comment I mislook. So I just updated he full file SDLActivity.java file.
@imsys
Copy link
Contributor Author

imsys commented Sep 12, 2025

The Android Apk doesn't crash anymore! But the keyboard is not showing up. I can fix it, just give me a bit of time.

[Gemini 2.5 Pro] The custom virtual keyboard on Android is no longer
displayed after updating the underlying SDL library from v2.26.2 to
v2.32.10.

This was caused by a change in how the new version of `SDLActivity.java`
handles text input. The newer SDL version more aggressively activates
its own text input system (`SDL_StartTextInput()`) on Android.

The TIC-80 C code in `src/system/sdl/main.c` has a function,
`isKbdVisible()`, which determines whether to render the custom
keyboard. This function contained a specific check for Android:
`!SDL_IsTextInputActive()`. This line was intended to hide the custom
keyboard when a native (e.g., system) keyboard was active.

Because the newer SDL version keeps its text input system active by
default, this check was causing the custom TIC-80 keyboard to be
permanently hidden.

This change resolves the issue by commenting out the
`!SDL_IsTextInputActive()` check. This restores the intended behavior,
ensuring that TIC-80's own integrated virtual keyboard is always used
for input on touch devices, independent of the underlying SDL text input
state.
Tries to make the system keyboard show when it was previously working.
The virtual keyboard was not appearing after updating SDL to v2.32.10.

The new `SDLActivity.java` now enables text input on launch by default,
which caused TIC-80's logic to hide its custom keyboard.

This is fixed by adding an explicit `SDL_StopTextInput()` call during
initialization to restore the correct default state. A redundant text
input call was also removed from the `SDL_KEYDOWN` handler to ensure the
system keyboard is only activated by its specific toggle key.
@imsys imsys marked this pull request as ready for review September 13, 2025 04:08
@imsys
Copy link
Contributor Author

imsys commented Sep 13, 2025

This is now working on my device.
I can install the apk, and the virtual keyboard works.

Copy link
Owner

@nesbox nesbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nesbox nesbox merged commit 70b0ba3 into nesbox:main Sep 13, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in dev version 1.2 Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants