Skip to content

Improve CJK IME interaction#758

Open
cammeresi wants to merge 1 commit intoskyjake:devfrom
cammeresi:20260228-ime
Open

Improve CJK IME interaction#758
cammeresi wants to merge 1 commit intoskyjake:devfrom
cammeresi:20260228-ime

Conversation

@cammeresi
Copy link

  • plumb TEXTEDITING{,_EXT} events (text being composed, not committed)
  • delete selected text when composition starts
  • store text being composed
  • render being-composed text after the cursor with an underline
  • draw cursor after being-composed text so candidate selection UI appears in the correct place

Fixes #417

I finally got curious and spent a little time debugging. I found several problems, about half of which are in this patch.

The other half of the problems are in SDL, so this patch is NOT a complete fix. But after appropriate review, I'll see if I can send a patch to that project as well.

Please note that out of CJK, I can only do some K. I don't really do C or J, and I gather from the API that the C/J IMEs have some behaviors that have no analogues in K. So to the extent that C/J act differently from K, I have not tested those aspects. For example, C/J apparently allow editing of the middle of being composed text, whereas K is simpler and allows only appending keystrokes to or deleting them from the end. AI implemented support for displaying being-composed-text-while-editing-the-middle, but I have not tested it.

It's a little more code than I wish it were, but I think there should be no risk of regression in the non-CJK case.

Let me know what you think. If you have comments, I'll try to address them.

- plumb TEXTEDITING{,_EXT} events (text being composed, not committed)
- delete selected text when composition starts
- store text being composed
- render being-composed text after the cursor with an underline
- draw cursor after being-composed text so candidate selection UI
  appears in the correct place
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

Successfully merging this pull request may close these issues.

Issues with CJK Input

1 participant