Skip to content

Conversation

jrmoulton
Copy link

Fixes #3342

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

This makes it so that if IME is enabled, events will be sent as IME::Commit instead of using keyDown. This is necessary because for input such as emoji, you cannot rely on any previous state to signify that the text will be handled by a keyDown.

@jrmoulton jrmoulton requested a review from madsmtm as a code owner October 9, 2025 10:29
Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that IME is pretty much always enabled, I'm not sure if that's how it should be done, since it probably will break pretty much all the input (if I read what you describe correctly).

If we can detect the source of the text, etc, then we could probably properly wire it through Ime::Commit?

@jrmoulton
Copy link
Author

since it probably will break pretty much all the input (if I read what you describe correctly).

Yes, if IME is enabled but not handled, the input will be sent over IME and not over keydown and be lost.

macOS doesn't change the reported input source when the emoji and symbol picker is used. I think the correct way to handle text input on macOS when IME is enabled is to send the through IME and not through keyDown. The appkit documentation just expects the insertText function to be handled directly. This is a breaking change though.

Given that IME is pretty much always enabled

I think there is a case to be made as well that if IME is enabled, it should be handled or disabled otherwise.

I'm not under any pressure to get this merged soon, but I do think that this is the correct way to handle text input on macOS and to fix #3342.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

IME and the MacOS Character Viewer

2 participants