News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

[r12275] Can't use text select tools on Android

Started by Mishasama, September 15, 2026, 05:52:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mishasama

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.
Because of some reason. I am looking for volunteers who can help me update the Pak64.Nightly.

I'm helping to build the Chinese community for now.
如果您是使用中文的玩家,歡迎到這裏尋找同好或張貼您們組織的聯係方式。
如果你是中文玩家,欢迎来这个帖子里找组织或者贴出你们的联系方式。

prissi

#1
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).

Mishasama

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.
Because of some reason. I am looking for volunteers who can help me update the Pak64.Nightly.

I'm helping to build the Chinese community for now.
如果您是使用中文的玩家,歡迎到這裏尋找同好或張貼您們組織的聯係方式。
如果你是中文玩家,欢迎来这个帖子里找组织或者贴出你们的联系方式。

prissi

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.

Mishasama

Quote from: prissi on Yesterday at 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?
Because of some reason. I am looking for volunteers who can help me update the Pak64.Nightly.

I'm helping to build the Chinese community for now.
如果您是使用中文的玩家,歡迎到這裏尋找同好或張貼您們組織的聯係方式。
如果你是中文玩家,欢迎来这个帖子里找组织或者贴出你们的联系方式。

prissi

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.