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

Implemented IME preview text for CJK characters in SDL2 backend #7461

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

katemonster33
Copy link

@katemonster33 katemonster33 commented Apr 2, 2024

Added support for displaying the IME preview text in an InputText field when the backend requests it to be shown. ( #5878 )

The internal buffers for InputText are not modified, the behavior currently only works for single-line InputText fields.

pre-edit-1

@katemonster33
Copy link
Author

No interest here? I don't like leaving PRs open in my list, i will close this in a few days if there's no activity

@ocornut
Copy link
Owner

ocornut commented Apr 14, 2024

There is always interest unless closed. I prefer to keep PR open to track useful ideas and references. It most often takes a long time until things gets fixed/finished and merged so I am unlikely to finish that work soon. If you get impatient feel free to close that but that’s essentially retracting your (legit/viable) idea from the pool of ideas.

I noticed you closing issues before I have a chance to get through them, which is unfortunate but my resources are limited.

@katemonster33
Copy link
Author

Ok I just wasn't familiar with your workflow here

@seagetch
Copy link

seagetch commented May 6, 2024

I have backported this patch to old version of ImGui on MacOS, and found a problem.
When I pressed enter to confirm the pre-edit text in Japanese, all pre-edit text is removed.
It seems enter key event is sent first in MacOS.

I added following code in KEYDOWN/KEYUP event, and it worked fine in MacOS.


    case SDL_KEYDOWN:
    case SDL_KEYUP:
    {
        if (event->key.keysym.sym == SDLK_RETURN && strlen(io.PreEditText) > 0) {
            // Ignore keyevent when preedit text exists.
            return false;
        }

And it worked fine in Ubuntu Linux 22.4 without any additional patches, with fcitx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants