Allow pasting into input popup on tiles build #47263
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Interface "Allow pasting into input popup on tiles build"
Purpose of change
Allow pasting content from the clipboard into input popups. I imagine this can be useful when you want to search for items etc by name from an external source (item browser, for example). This can also be useful for windows IME users to workaround a SDL bug that makes IME input in the game difficult, by inputing the text into a text editor and then pasting the text into the game instead.
Describe the solution
Test
ctrl-v
instring_input_popup
and insert clipboard text into the string.Testing
Copied some English and Chinese text from a text editor into a input popup successfully.
Additional context
SDL has a half-done implementation of custom IME candidate list, so neither the system IME candidate list nor the custom one is rendered correctly. If we want this fixed we probably need to compile our own patched SDL, as although a patch has been submitted to the SDL bug tracker two years ago, there doesn't seem to be any intention to merge it or fix the implementation.