5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Karabiner-Elementsで英数/かな/矢印/Enter/Delete/Tab/Esc周りの設定

Posted at

macOS Sierraにアップグレードしたことで、Karabinerが使えなくなったので、代わりにkarabiner-Elementsを導入。

その際に「英数/かな/矢印/Enter/Delete/Tab/Esc」周りの設定をカスタマイズしたのでその際のメモ。

やりたいこと

  • 右CommandキーFunctionキー(以下fn)
  • fn + D/F英数/かな
  • fn + ;/H/N/OEnter/Delete/Escape/Tab
  • fn + I/J/K/L矢印(↑/←/↓/→)キー

要は右Commandキーと各種キーを組み合わせることで、基本的な操作が出来るようにしたい。

やったこと

設定ファイルのsimple_modificationscomplex_modificationsを修正した。その他は省いているので注意。
(※ 実際には一部はGUIを通して設定したが、設定ファイルで以下のように変更してもたぶん同じ)

~/.config/karabiner/karabiner.json
"simple_modifications": {
    "right_command": "fn"
},
"complex_modifications": {
    "parameters": {
      #省略
    },
    "rules": [
        {
            "description": "Change fn + d/f to eisuu/kana",
            "manipulators": [
                {
                    "from": {
                        "key_code": "f",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ],
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "japanese_kana"
                        }
                    ],
                    "type": "basic"
                },
                {
                    "from": {
                        "key_code": "d",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ],
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "japanese_eisuu"
                        }
                    ],
                    "type": "basic"
                }
            ]
        },
        {
            "description": "Change fn + ;/h/n/o to Enter/Delete/Escape/Tab",
            "manipulators": [
                {
                    "from": {
                        "key_code": "semicolon",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ],
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "return_or_enter"
                        }
                    ],
                    "type": "basic"
                },
                {
                    "from": {
                        "key_code": "h",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ],
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "delete_or_backspace"
                        }
                    ],
                    "type": "basic"
                },
                {
                    "from": {
                        "key_code": "n",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ],
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "escape"
                        }
                    ],
                    "type": "basic"
                },
                {
                    "from": {
                        "key_code": "o",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ],
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "tab"
                        }
                    ],
                    "type": "basic"
                }
            ]
        },
        {
            "description": "Change fn + I/J/K/L to Arrow Keys",
            "manipulators": [
                {
                    "from": {
                        "key_code": "i",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ],
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "up_arrow"
                        }
                    ],
                    "type": "basic"
                },
                {
                    "from": {
                        "key_code": "j",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ],
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "left_arrow"
                        }
                    ],
                    "type": "basic"
                },
                {
                    "from": {
                        "key_code": "k",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ],
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "down_arrow"
                        }
                    ],
                    "type": "basic"
                },
                {
                    "from": {
                        "key_code": "l",
                        "modifiers": {
                            "mandatory": [
                                "fn"
                            ],
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "right_arrow"
                        }
                    ],
                    "type": "basic"
                }
            ]
        }
    ]
},
5
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?