Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] SDL_ResetTextInput function #4847

Closed
jai-x opened this issue Oct 17, 2021 · 3 comments
Closed

[Proposal] SDL_ResetTextInput function #4847

jai-x opened this issue Oct 17, 2021 · 3 comments
Milestone

Comments

@jai-x
Copy link

jai-x commented Oct 17, 2021

Motivation

During a text entry when an IME candidate list is invoked, user input may occur which still keeps the textbox in focus but interrupts the current candidate text selection (i.e. clicking to a different word in the same textbox). Ideally this should result in the candidate window to be dismissed but also keep the state for SDL_StartTextInput such that new TEXTINPUT events can be receieved.

I find that calling SDL_StopTextInput followed by SDL_StartTextInput not really a full solution to these sort of user interactions, especially in the case of screen keyboards which will close then immedialely reopen resulting in poor user experience.

This proposal was brought about by attempting to integrate SDL IME text input to the osu-framework in this PR: ppy/osu-framework#4709

Proposed Functionality

Function name

  • SDL_ResetTextInput

When text input is stopped, this function should

  • Have no effect

When text input is started, this function should

  • Dismiss any open IME candidate window
  • Reset the platform IME state to clear candidate input
  • Send an empty SDL_TEXTEDITING event

Feedback and implementation

If there is any feedback to this proposal that would be great. I would be interested in implementing this myself once appropriate feedback has been received.

@slouken
Copy link
Collaborator

slouken commented Mar 17, 2022

@zreedy, is this taken care of with your changes?

@slouken slouken added the waiting Waiting on user response label Mar 17, 2022
@zreedy
Copy link
Contributor

zreedy commented Mar 18, 2022

@slouken This is implemented as SDL_ClearComposition. It works as documented by the author, although I was not aware of this ticket originally when it was written we just needed the function. Happy accident!

@slouken slouken removed the waiting Waiting on user response label Mar 18, 2022
@slouken
Copy link
Collaborator

slouken commented Mar 18, 2022

Okay, thanks!

@slouken slouken closed this as completed Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants