Karabiner-Elementsでcontrol+j/i/k/mを矢印キーに変更した
デフォルトの配列だと、矢印キーを打つ度にキーボードのホームポジションから手を移動させないといけない。
毎回移動が面倒なので、Karabiner-Elementsを利用してcontrol+j/i/k/mを矢印キーと同じ挙動に変更した。
スペック
・macOS:Catalina
・Karabiner-Elements:12.9.0
変更内容
以下のようにcontrolとJ/I/K/Mのキーを組み合わせで、矢印キーと同じ挙動になるようにした。
・control + j => 左(←)
・control + i => 上(↑)
・control + k => 右(→)
・control + m => 下(↓)
Karabiner-Elementsの設定
・Karabiner-Elementsをインストール
Karabiner-Elements - Software for macOS
https://pqrs.org/osx/karabiner/
・Complex modificationsの独自ルール作成
control + j/i/k/mで矢印キーになるようにindex.jsonを作成して、以下に置く。
$ cd ~/.config/karabiner/assets/complex_modifications
index.json
{ "title": "left_control + j/i/k/m to arrow keys", "rules": [ { "description": "left_control + j/i/k/m to arrow keys", "manipulators": [ { "type": "basic", "from": { "key_code": "j", "modifiers": { "mandatory": [ "left_control" ], "optional": [ "any" ] } }, "to": [ { "key_code": "left_arrow" } ] }, { "type": "basic", "from": { "key_code": "i", "modifiers": { "mandatory": [ "left_control" ], "optional": [ "any" ] } }, "to": [ { "key_code": "up_arrow" } ] }, { "type": "basic", "from": { "key_code": "k", "modifiers": { "mandatory": [ "left_control" ], "optional": [ "any" ] } }, "to": [ { "key_code": "right_arrow" } ] }, { "type": "basic", "from": { "key_code": "m", "modifiers": { "mandatory": [ "left_control" ], "optional": [ "any" ] } }, "to": [ { "key_code": "down_arrow" } ] } ] } ] }
以下ページに独自ルールのサンプルが載っています。より複雑な指定がしたい場合は、参考にしてみてください。
karabiner-elements-complex_modifications
https://pqrs.org/osx/karabiner/complex_modifications/
・Complex modificationsに独自ルールを設定
Karabiner-Elements->Complex modification->RulesにあるAdd Ruleボタンを押すと以下が表示される。
先程作成した独自ルールが追加されてるので「left_control + j/i/k/m to arrow keys」のEnableボタンを押すと設定が完了し、これで矢印キーと同じ挙動をするようになります。