You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the implementation of insertText is insufficient to cover some input methods that can commit text without setting a preedit. (e.g. when the input method translates a certain key and directly commits the translation.)
Known affected downstream programs include Alacritty and Neovide.
Examples
A typical example is the full-width punctuation. If you hit the period key with the input method enabled, it will commit 。 to the program without ever setting a preedit.
Another example is SKK-style Japanese input methods, with which, e.g. a directly commits あ without any preedit. Currently, both full-width punctuation and SKK Japanese input method doesn't work properly.
Analysis
Upon inspection, I found that insertText will only commit text when there is a preedit. (Hence the description above.)
I removed the condition and it almost worked for me. However, it seems to be added in commit 3fd7384 for a good reason.
By "almost" above, I mean it's still not fully satisfactory.
On startup, the IME is disabled and only gets enabled after a preedit is set once. That is, for full-width punctuation to work, one has to input something to enter the IME state. For SKK, the situation could get a bit problematic. This should also be fixed. (I think this probably belongs to a separate issue? It could be fixed by setting Ground to be the default. But I might be missing some details here.)
Some input methods support toggle keys. For example, in SKK, q toggles Hiragana and Katagana input. If I removed the preedit check, whenever I type q, the input method can receive q (toggling katagana) and another q will also be forwarded to the application.
Another thing is that I noticed the system input methods can commit full-width punctuation just fine. But to my surprise I didn't manage to find any difference in the logs. So I don't really understand what's going on.
Description
Description
Currently, the implementation of
insertText
is insufficient to cover some input methods that can commit text without setting a preedit. (e.g. when the input method translates a certain key and directly commits the translation.)Known affected downstream programs include Alacritty and Neovide.
Examples
。
to the program without ever setting a preedit.a
directly commitsあ
without any preedit. Currently, both full-width punctuation and SKK Japanese input method doesn't work properly.Analysis
Upon inspection, I found that
insertText
will only commit text when there is a preedit. (Hence the description above.)I removed the condition and it almost worked for me. However, it seems to be added in commit 3fd7384 for a good reason.
winit/src/platform_impl/apple/appkit/view.rs
Lines 406 to 411 in 7e819bb
Notes
By "almost" above, I mean it's still not fully satisfactory.
Ground
to be the default. But I might be missing some details here.)q
, the input method can receiveq
(toggling katagana) and anotherq
will also be forwarded to the application.Another thing is that I noticed the system input methods can commit full-width punctuation just fine. But to my surprise I didn't manage to find any difference in the logs. So I don't really understand what's going on.
macOS version
Winit version
0.30.3
The text was updated successfully, but these errors were encountered: