-
Notifications
You must be signed in to change notification settings - Fork 26
Description
I'm running into a strange problem where I can use xkbswitch
to switch IMEs, but for certain non-Latin input methods, input to the current window comes out as US English until you switch to another window.
Specifically, I've tested on a handful of languages (Arabic, Spanish, English, Japanese-Hiragana, Japanese-Katakana, Korean, Simplified Chinese-Pinyin, Traditional Chinese-Zhuyin), and it only seems to be happening in Korean and Chinese (both Pinyin and Zhuyin) — both East Asian IMEs with alternate modes for English input.
Observations:
-
It's not limited to the GUI terminal.
I thought it might just be limited to the terminal at first, but then tested by running
sleep 3 && xkbswitch -s 1
switching over to Firefox, waiting for the IME to change, and then starting to type. The same thing happens.
-
It's always US English output, even if you're switching from a non-Latin language. (Possibly because US English is the default on my system.)
If switching from Arabic to Chinese, US English characters still come out, not Arabic or Chinese. Usually, it's normal (single-width) characters, but sometimes (still haven't figured out why/when), it's double-width characters. Originally, this led me to believe that the unexpected US English input I was observing was a sub-mode of the IME that xkbswitch had switched to, but then I noticed the following:
Both Korean and Chinese IMEs offer some mechanism for inputting US English characters without having to switch back to the English IME (in Zhuyin, caps lock will force all input to Latin/QWERTY; in Korean, holding down
<Option>
does the same). The behavior described in this issue is not a result of triggering these mechanisms: when this problem begins,<Option-a>
outputs ‘å’, which is ordinarily not possible in Zhuyin. -
xkbswitch
appears to preserve some IME statefulness that is not preserved by the standard system keyboard shortcut for switching IMEs.This one's kind of hard to explain, so I'll format it as a series of shell commands with comments:
$ xkbswitch -s 1 # switches to Chinese $ asdf # at this point, input comes out in Latin/QWERTY # but if I switch to Firefox, the Chinese IME begins working correctly # and if I switch back to the terminal... $ ㄅㄆㄇㄈ # Chinese continues to work $ xkbswitch -s 0 # at that point, I can switch back to English (pulling up this command via readline history) $ xkbswitch -s 1 # then back to Chinese $ ㄅㄆㄇㄈ # and it works _without having to switch windows_ # but then if I switch back to English with the system keyboard shortcut (CMD-Space) $ xkbswitch -s 1 # and switch back to Chinese again $ asdf # then we're back where we started...
Thoughts?