Manage text input source on macOS using NSTextInputContext.
miyako/4d-plugin-text-input-context
-
サンプルプログラムは,プロジェクトモードで開いてください。(17r5以降)
-
オブジェクト型やコレクション型を使用しています。(v17以降)
-
スレッドセーフです。
-
v16以前で使用する場合,Releasesから
1.0版をダウンロードしてください。 -
-carbonとタグ付けされているリリースは,32/64ビット対応です。
SET INPUT SOURCE (source)
Pass an NSTextInputSourceIdentifier e.g. com.apple.keylayout.US to source.
入力ソースを切り替えます。ソースの識別子は,_o_INPUT SOURCES LIST _o_Get input sourceなどから返される文字列です。
例:
com.apple.inputmethod.Kotoeri.Japanese
jp.co.ergo.egbridge_universal_2.component.Japanese
com.justsystems.inputmethod.atok22.Japanese
com.google.inputmethod.Japanese.base
GET INPUT SOURCE LOCALES (locales)
ALL ROMAN INPUT SOURCES is returned for NSAllRomanInputSourcesLocaleIdentifier.
カレントの入力ソースが対応しているロケールのリストが返されます。デフォルトは空の配列です。
SET INPUT SOURCE LOCALES (locales)
Pass ALL ROMAN INPUT SOURCES to specify NSAllRomanInputSourcesLocaleIdentifier.
Pass an empty array to allow any locale.
ロケールは,一般的な言語コードで指定します。英数一般はALL ROMAN INPUT SOURCES定数で指定することができます。空の配列を渡した場合,ロケールの制限はありません。英数モードから復帰する場合,他の言語が制限されたままにならないよう,日本語(ja)ではなく,空の配列を渡すようにしてください。
sources:=Input sources list
Returns a collection of objects that contains information about keyboard text input sources.
選択できる入力モードのコレクションが返されます。キーボードビューアや絵文字と記号のパレットは含まれません。_o_は,単純に識別子だけが配列で返されます。
Text input source
| Property | Type | Description |
|---|---|---|
| source | OBJECT | |
| source.id | TEXT | |
| source.name | TEXT | localizedNameForInputSource |
_o_INPUT SOURCES LIST (sources)
Simply returns an array of identifier string (selectedKeyboardInputSource) of keyboard text input sources.
source:=Get input source
Returns an object that contains information about the currently selected keyboard text input source.
カレントの入力モードに関する情報がオブジェクト型で返されます。_o_は,単純に識別子だけが文字列で返されます。
Text input source
| Property | Type | Description |
|---|---|---|
| source | OBJECT | |
| source.id | TEXT | |
| source.name | TEXT | localizedNameForInputSource |
| source.category | TEXT | kTISPropertyInputSourceCategory |
| source.type | TEXT | kTISPropertyInputSourceType |
| source.icon | PICTURE | kTISPropertyIconRef or content of kTISPropertyIconImageURL |
| source.languages[] | COLLECTION | kTISPropertyInputSourceLanguages |
source:=_o_Get input source
Simply returns the identifier string (selectedKeyboardInputSource) for the currently selected keyboard text input source.