- Install Karabiner Elements
- Open your karabiner.json file (it will be in
~/.config/karabiner/karabiner.json
). - Find
complex_modifications
. It will have a keyrules
that takes a list ("rules": [...]
). - Inside the square brackets, paste this:
{
"description": "Change Caps Lock + I/J/K/L to Arrow Keys",
"manipulators": [
{
"from": {
"key_code": "caps_lock"
},
"to": [
{
"set_variable": {
"name": "caps_arrows_mode",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_arrows_mode",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_arrows_mode",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
}
]
}
For anyone coming here looking for the answer to modifier keys: this is the fix needed to the above -- Change the first
manipulators
line to: