Closed isage closed 1 year ago
Do you have a proposed patch that implements this, and a test program to verify it?
Nope
This is bumping out of 2.0.18, but I would like to do something like this for the Switch branch sooner than later, so I might take a stab at it for 2.0.20.
SDL 2.0 is now in maintenance mode, and all inactive issues are being closed. If this issue is impacting you, please feel free to reopen it with additional information.
There are platforms (psvita / switch), where on-screen keyboard takes whole screen and have no way to provide
SDL_TEXTEDITING
event. Instead, those support setting initial text and dialog title. They also allow to set dialog type (e.g. text, numeric, etc.)Proposal is to have something like
SDL_StartTextInputAdvanced(const char* title, const char* initial_text, SDL_ImeType type);
That also requires different fromSDL_TEXTINPUT
event, becauseSDL_TEXTINPUT
works properly only in conjunction withSDL_TEXTEDITING
.This was requested by devilutionX developers, so here's real life usage example: When creating new player character, engine generates initial name for it, which player can change. Problem 1: right now it's impossible to pass such name to OSK. Problem 2: After user finishes text input in OSK, OSK sends SDL_TEXTINPUT event with whole text. So while on desktop platforms this works well, because there's SDL_TEXTEDITING event, and if user removed/edited initial name - that's handled, on vita and switch that leads to text from OSK being appended to initial player name instead, as engine doesn't/can't know if initial name was edited/removed.