-
Notifications
You must be signed in to change notification settings - Fork 26
Description
日本語で失礼します。
入力ソースとしてGoogle日本語入力を選択した場合、即座に切り替わらない現象を確認しました。
環境
- macOS Sierra
- 英字配列キーボード(無関係?)
再現手順
- Google日本語入力が有効となっていることを確認する。
% InputSourceSelector list-enabled
com.apple.keylayout.US (U.S.)
com.apple.inputmethod.Kotoeri.Japanese (Hiragana)
com.apple.inputmethod.Kotoeri.Roman (Romaji)
com.apple.inputmethod.Kotoeri.Japanese.Katakana (Katakana)
com.apple.inputmethod.Kotoeri (Japanese)
com.apple.50onPaletteIM (Japanese Kana Palette)
com.google.inputmethod.Japanese.base (Hiragana (Google))
com.google.inputmethod.Japanese (Google Japanese Input)
com.google.inputmethod.Japanese.Roman (Alphanumeric (Google))
- 英字入力からGoogle日本語入力に切り替える。
% InputSourceSelector select com.google.inputmethod.Japanese.base
- 画面右上の通知としては入力ソースが切り替わるが、ターミナル上では英字入力のままの状態になる。ただし、ウィンドウを切り替えると入力ソースが正常に切り替わる。
「ことえり」に切り替えた場合はこの症状は起きず、即座に入力ソースが切り替わります。
考察
ことえりで起きないことから、どうやら入力ソース依存なのかもしれません。stackoverflowでも似たような症状に悩む投稿があります。
http://stackoverflow.com/questions/22885767/how-to-programmatically-switch-an-input-method-on-os-x
この中で、下記のような興味深いコメントがあります。
Oh! You’re trying to change the input method to affect another process. Typically these APIs are used by an application to select an IM for itself or one of its documents. If there’s a supported means to do this, it probably involves sending a notification to other processes. Also, beware of the interaction with the “Automatically switch to a document’s input source” system preference, which may affect your results.
推測するに、入力ソースの切り替わりをプロセスに通知するタイミングが、ことえりとGoogle日本語入力で異なるのかもしれません(ことえりは即座に通知するのに対し、Google日本語入力はそうではない?)。もちろん環境依存の可能性も考えられます。
minokiさんの環境ではこのような症状は発生しておりませんでしょうか?