Google日本語入力の変換性能が劣化しすぎててApple純正のことえりに戻したいが、テンキー入力時の挙動だけがネックな件

Google日本語入力の変換性能が劣化しすぎててApple純正のことえりに戻したいが、テンキー入力時の挙動だけがネックな件

ここ最近、Google日本語入力の変換がどうにもならないくらいの誤変換っぷりでストレスがすごい。

新しいマシンを設定する時にことえり(Apple純正のIME)をちょっと使ったら結構良くなっていて、こっちに切り替えるか!と思ったものの一点だけ譲れない点が動作しない。

それは、テンキー入力した数字が確定されてしまう事。

Goole日本語入力の場合、かなモードでテンキーから数字を入力した時には通常の数字キーと同様の動作となり、変換待ちで入力できる。

これは、金額の桁わけ(3桁ごとにカンマ)をする時に便利かつミス防止ができて重宝している機能で使えないと不便。

kanabiner-Elementsで出来るっぽいのでやってみた。

⌨️ Karabiner-Elementsでテンキーを“かなモード中のみ”変換対象にする方法【macOS + Apple日本語IME】

✅ 実現したいこと

  • macOS純正の日本語入力(かなモード)中に限り
  • テンキー 0〜9 を通常の数字キーとして扱い
  • 漢数字やカンマ付き数字などへ変換できるようにする

手順

  1. 下記ディレクトリに移動:

    mkdir -p ~/.config/karabiner/assets/complex_modifications
    cd ~/.config/karabiner/assets/complex_modifications
  2. JSONファイルを作成:

    code tenkey_japanese_mode.json

📝 JSONファイルの内容

注:下記は環境によって値を変更する必要がある

              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }

tenkey_japanese_mode.json

{
  "title": "テンキー数字をかなモード中のみ通常キーとして変換対象にする",
  "rules": [
    {
      "description": "テンキー0〜9を、かなモード中のみ通常キーとして扱う",
      "manipulators": [
        {
          "type": "basic",
          "from": { "key_code": "keypad_0" },
          "to": [ { "key_code": "0" } ],
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }
              ]
            }
          ]
        },
        {
          "type": "basic",
          "from": { "key_code": "keypad_1" },
          "to": [ { "key_code": "1" } ],
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }
              ]
            }
          ]
        },
        {
          "type": "basic",
          "from": { "key_code": "keypad_2" },
          "to": [ { "key_code": "2" } ],
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }
              ]
            }
          ]
        },
        {
          "type": "basic",
          "from": { "key_code": "keypad_3" },
          "to": [ { "key_code": "3" } ],
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }
              ]
            }
          ]
        },
        {
          "type": "basic",
          "from": { "key_code": "keypad_4" },
          "to": [ { "key_code": "4" } ],
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }
              ]
            }
          ]
        },
        {
          "type": "basic",
          "from": { "key_code": "keypad_5" },
          "to": [ { "key_code": "5" } ],
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }
              ]
            }
          ]
        },
        {
          "type": "basic",
          "from": { "key_code": "keypad_6" },
          "to": [ { "key_code": "6" } ],
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }
              ]
            }
          ]
        },
        {
          "type": "basic",
          "from": { "key_code": "keypad_7" },
          "to": [ { "key_code": "7" } ],
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }
              ]
            }
          ]
        },
        {
          "type": "basic",
          "from": { "key_code": "keypad_8" },
          "to": [ { "key_code": "8" } ],
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }
              ]
            }
          ]
        },
        {
          "type": "basic",
          "from": { "key_code": "keypad_9" },
          "to": [ { "key_code": "9" } ],
          "conditions": [
            {
              "type": "input_source_if",
              "input_sources": [
                {
                  "input_source_id": "com.apple.inputmethod.Kotoeri.RomajiTyping.Japanese",
                  "input_mode_id": "com.apple.inputmethod.Japanese"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

🧪 反映手順(Karabiner内)

  1. Karabiner-Elements アプリを起動
  2. 「Complex Modifications」タブ → 「Add Rule」ボタン
  3. 先ほど作成したルール「テンキー0〜9を、かなモード中のみ通常キーとして扱う」を追加

Karabiner-Elements

Karabiner-Elements

🎉 効果の確認

  1. macOSのIMEを「かな(日本語)」に切り替える
  2. テンキーで 1234 を入力
  3. スペースキーで変換ができる(カンマ付き、漢数字、全角など)

💬 補足:なぜこうしないといけないの?

Apple純正IMEは、テンキー入力を「確定済み」として扱うため、変換ができない。
Google日本語入力はこの点に配慮しており、テンキーでも未確定状態(アンダーライン)で保持される。
Karabinerを使えば、テンキーの入力を通常キーにリマップして未確定状態に持ち込むことで、変換を可能にできる。

🧩 おまけ:EventViewerでのIME確認方法

IMEの input_source_id は環境によって異なるため、以下で確認可能して変更する必要があるかも。

  1. Karabiner-EventViewer を起動
  2. Input Source タブを選択
  3. かな・英数の切替をして、input_source_id や input_mode_id を確認

karabina-EventViewer

これでしばらく使ってみる