macOS Sierraにアップグレードしたことで、Karabinerが使えなくなったので、代わりにkarabiner-Elementsを導入。
その際に「英数/かな/矢印/Enter/Delete/Tab/Esc」周りの設定をカスタマイズしたのでその際のメモ。
やりたいこと
-
右Commandキー
⇒Functionキー(以下fn)
-
fn + D/F
⇒英数/かな
-
fn + ;/H/N/O
⇒Enter/Delete/Escape/Tab
-
fn + I/J/K/L
⇒矢印(↑/←/↓/→)キー
要は右Commandキー
と各種キーを組み合わせることで、基本的な操作が出来るようにしたい。
やったこと
設定ファイルのsimple_modifications
、complex_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"
}
]
}
]
},