In a text box, you cannot use the soft keyboard or the native Android method to select specific text content for copying or cutting.
By the way, I'm using Gboard.
I have set env_t::hide_keyboard to false, which generates again SDL_StartTextInput(). But it may now that you cannot hide the keyboard any more. Please test the next nightly on Android (should be r12277).
Quote from: prissi on September 16, 2026, 06:33:30 AMI have set env_t::hide_keyboard to false, which generates again SDL_StartTextInput(). But it may now that you cannot hide the keyboard any more. Please test the next nightly on Android (should be r12277).
Tested under r12278.
The copy and paste function is still unavailable; currently, only text selection is possible.
And it has been confirmed that the on-screen keyboard can be closed using the back button.
We already use SDL_copy() and SDL_paste(), so Cntrol+C (...) should copy to the Andriod Clipboard. However, if I trust Gemini, Gboard uses a different, higher API than the standard API SDL2 uses for text input and clipboard.
Quote from: prissi on September 19, 2026, 08:43:52 AMHowever, if I trust Gemini, Gboard uses a different, higher API than the standard API SDL2 uses for text input and clipboard.
The problem is that without a physical keyboard on Android, it's currently impossible to access the text command menu by long-pressing. As a result, actions like copying and pasting are unavailable.
I think most on-screen keyboards that offer similar functionality use the same system API, not limited to Gboard. And it's unlikely they would use a non-native solution like SDL2.
Perhaps we could consider providing shortcut keys for frequently used functions on the toolbar, similar to the CTRL key?
SDL is foremost a game library, trying to get keystrokes as fast as possible and thus not so well suited for normal texthandling, which was hacked on much later.
Maybe longterm we should cook up a simsys_android.cc like the window gdi one, we just need screen copy and passing event down and could remove most Android defines in the code. With the current advances with AI coding, a kind of translation should become feasible, hopefully.
Quote from: prissi on September 19, 2026, 10:51:48 PMWith the current advances with AI coding, a kind of translation should become feasible, hopefully.
I've heard that the most reliable code writing AI right now is CLAUDE, and they offer free access to open-source projects. Maybe you could give it a try.