MacOS Karabiner-Elements で英数/かな トグル

以前に ⌘英かな + Karabiner-Elements で「英数」キーと「かな」キーで日本語入力の切り替えトグルを実現していたが Karabiner-Elements のアップデートで、Karabiner-Elements単体でのトグルと、アプリケーション切り替えが利用可能になっていた

Windowsへのリモートデスクトップでは、USキーボードの問題から別の定義を作成したので、frontmost_application_unless を用いて除外


kanatoggle.json
  1. {  
  2.   "title""日本語入力トグル",  
  3.   "rules": [  
  4.     {  
  5.       "description""英数トグル",  
  6.       "manipulators": [  
  7.         {  
  8.           "type""basic",  
  9.           "description""入力ソースが英字の場合、かなへ変更(RDP以外)",  
  10.           "from": {  
  11.             "key_code""japanese_eisuu"  
  12.           },  
  13.           "to": [  
  14.             {  
  15.               "key_code""japanese_kana"  
  16.             }  
  17.           ],  
  18.           "conditions": [  
  19.             {  
  20.               "type""input_source_if",  
  21.               "input_sources": [  
  22.                 {  
  23.                   "language""en"  
  24.                 }  
  25.               ]  
  26.             },  
  27.             {  
  28.               "type""frontmost_application_unless",  
  29.               "bundle_identifiers": [  
  30.                 "^com\\.microsoft\\.rdc\\.",  
  31.                 "^com\\.2X\\.Client\\.Mac"  
  32.               ]  
  33.             }  
  34.           ]  
  35.         }  
  36.       ]  
  37.     },  
  38.     {  
  39.       "description""かなトグル",  
  40.       "manipulators": [  
  41.         {  
  42.           "type""basic",  
  43.           "description""入力ソースがひらがなの場合、英数へ変更(RDP以外)",  
  44.           "from": {  
  45.             "key_code""japanese_kana"  
  46.           },  
  47.           "to": [  
  48.             {  
  49.               "key_code""japanese_eisuu"  
  50.             }  
  51.           ],  
  52.           "conditions": [  
  53.             {  
  54.               "type""input_source_if",  
  55.               "input_sources": [  
  56.                 {  
  57.                   "language""ja"  
  58.                 }  
  59.               ]  
  60.             },  
  61.             {  
  62.               "type""frontmost_application_unless",  
  63.               "bundle_identifiers": [  
  64.                 "^com\\.microsoft\\.rdc\\.",  
  65.                 "^com\\.2X\\.Client\\.Mac"  
  66.               ]  
  67.             }  
  68.           ]  
  69.         }  
  70.       ]  
  71.     }  
  72.  ]  
  73. }  


※RDPの説明と画像が兼用なのをご了承ください
既に Karabiner-Elements を設定して利用している場合、Profilesから新しいプロファイルを作成してお試しください

  1. Karabiner-Elements のデータフォルダを開いて
  2. assets/complex_modifications に 上記の kanatoggle.json (UTF-8 であればファイル名は何でもよい)を作成またはコピペ
  3. Add rule を開いて
  4. 日本語入力トグルの Enable All で取り込む
    jsonが正しくない場合ココに表示されません
  5. 取り込まれて利用可能になるハズ

    ※jsonファイルを変更した時は、ここで Removeの後、再度取り込む必要があります







コメント