diff --git a/config/karabiner/karabiner.json b/config/karabiner/karabiner.json index 6426b3f..f2fb9cd 100644 --- a/config/karabiner/karabiner.json +++ b/config/karabiner/karabiner.json @@ -16,16 +16,19 @@ }, "rules": [ { - "description": "Change CapsLock + h/j/k/l to Arrows", + "description": "CAPS LOCK + hjkl to arrow keys, scroll with SHIFT, ESC alone", "manipulators": [ { - "description": "VI CapsLock-h to Move Left", + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], "from": { - "key_code": "h", + "key_code": "j", "modifiers": { - "mandatory": [ - "right_control" - ], "optional": [ "any" ] @@ -33,19 +36,22 @@ }, "to": [ { - "key_code": "left_arrow" + "key_code": "down_arrow" } ], "type": "basic" }, { - "description": "VI CapsLock-j to Move Down", + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], "from": { - "key_code": "j", + "key_code": "k", "modifiers": { - "mandatory": [ - "right_control" - ], "optional": [ "any" ] @@ -53,19 +59,22 @@ }, "to": [ { - "key_code": "down_arrow" + "key_code": "up_arrow" } ], "type": "basic" }, { - "description": "VI CapsLock-k to Move Up", + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], "from": { - "key_code": "k", + "key_code": "h", "modifiers": { - "mandatory": [ - "right_control" - ], "optional": [ "any" ] @@ -73,19 +82,22 @@ }, "to": [ { - "key_code": "up_arrow" + "key_code": "left_arrow" } ], "type": "basic" }, { - "description": "VI CapsLock-l to Move Right", + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], "from": { "key_code": "l", "modifiers": { - "mandatory": [ - "right_control" - ], "optional": [ "any" ] @@ -100,11 +112,18 @@ }, { "description": "VI CapsLock-0 to Beginning of Line", + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], "from": { "key_code": "0", "modifiers": { - "mandatory": [ - "right_control" + "optional": [ + "any" ] } }, @@ -120,11 +139,18 @@ }, { "description": "VI CapsLock-4 (as in $) to End of Line", + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], "from": { "key_code": "4", "modifiers": { - "mandatory": [ - "right_control" + "optional": [ + "any" ] } }, @@ -140,11 +166,18 @@ }, { "description": "VI CapsLock-b to Back Word", + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], "from": { "key_code": "b", "modifiers": { - "mandatory": [ - "right_control" + "optional": [ + "any" ] } }, @@ -160,11 +193,18 @@ }, { "description": "VI CapsLock-w to Forward Word", + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], "from": { "key_code": "w", "modifiers": { - "mandatory": [ - "right_control" + "optional": [ + "any" ] } }, @@ -177,12 +217,107 @@ } ], "type": "basic" - } - ] - }, - { - "description": "Change caps_lock key to right_control. (Post escape key when pressed alone)", - "manipulators": [ + }, + { + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "j", + "modifiers": { + "mandatory": [ + "shift" + ] + } + }, + "to": [ + { + "mouse_key": { + "vertical_wheel": 40 + } + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "k", + "modifiers": { + "mandatory": [ + "shift" + ] + } + }, + "to": [ + { + "mouse_key": { + "vertical_wheel": -40 + } + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "h", + "modifiers": { + "mandatory": [ + "shift" + ] + } + }, + "to": [ + { + "mouse_key": { + "horizontal_wheel": -30 + } + } + ], + "type": "basic" + }, + { + "conditions": [ + { + "name": "caps_lock pressed", + "type": "variable_if", + "value": 1 + } + ], + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "shift" + ] + } + }, + "to": [ + { + "mouse_key": { + "horizontal_wheel": -30 + } + } + ], + "type": "basic" + }, { "from": { "key_code": "caps_lock", @@ -194,7 +329,18 @@ }, "to": [ { - "key_code": "right_control" + "set_variable": { + "name": "caps_lock pressed", + "value": 1 + } + } + ], + "to_after_key_up": [ + { + "set_variable": { + "name": "caps_lock pressed", + "value": 0 + } } ], "to_if_alone": [ @@ -467,4 +613,4 @@ } } ] -} \ No newline at end of file +}