A powerful and stable keyboard customizer for macOS.

  • file path
~/.config/karabiner/assets/complex_modifications/gims-vim-like-map.json

-- my 2023-09-02 to implement "MacBook Pro Fn" layout in My Keyboard Layout
{
  "title": "gims Vim like map with smart capslock",
  "rules": [
    {
      "description": "CAPSLOCK + hjkl to arrow keys (Post ESCAPE if press CAPSLOCK alone)",
      "manipulators": [
        {
          "from": { "key_code": "j", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "down_arrow" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic"
        },
        {
          "from": { "key_code": "k", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "up_arrow" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic"
        },
        {
          "from": { "key_code": "h", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "left_arrow" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic"
        },
        {
          "from": { "key_code": "l", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "right_arrow" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic"
        },
        {
          "from": { "key_code": "u", "modifiers": { "optional": [ "any" ] } },
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "to": [ { "key_code": "delete_or_backspace" } ],
          "type": "basic"
        },
        {
          "from": { "key_code": "i", "modifiers": { "optional": [ "any" ] } },
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "to": [ { "key_code": "home" } ],
          "type": "basic"
        },
        {
          "from": { "key_code": "semicolon", "modifiers": { "optional": [ "any" ] } },
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "to": [ { "key_code": "end" } ],
          "type": "basic"
        },
        { "from": { "key_code": "period", "modifiers": { "optional": [ "any" ] } },
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "to": [ { "key_code": "delete_forward" } ],
          "type": "basic" },
        { "from": { "key_code": "n", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "page_down" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "m", "modifiers": { "optional": [ "any" ] }},
          "to": [ { "key_code": "page_up" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "1", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f1" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "2", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f2" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "3", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f3" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "4", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f4" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "5", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f5" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "6", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f6" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "7", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f7" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "8", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f8" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "9", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f9" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "0", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f10" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "hyphen", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f11" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "equal_sign", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "f12" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "open_bracket", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "volume_decrement" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "close_bracket", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "volume_increment" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "right_arrow", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "right_control" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "s", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "left_arrow" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "d", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "down_arrow" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "e", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "up_arrow" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        {
          "from": { "key_code": "f", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "right_arrow" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        { "from": { "key_code": "w", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "page_down" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        { "from": { "key_code": "r", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "page_up" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        { "from": { "key_code": "v", "modifiers": { "optional": [ "any" ] } },
          "to": [ { "key_code": "return_or_enter" } ],
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "type": "basic" },
        { "from": { "key_code": "c", "modifiers": { "optional": [ "any" ] } },
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "to": [ { "key_code": "delete_forward" } ],
          "type": "basic" },
        {
          "from": { "key_code": "t", "modifiers": { "optional": [ "any" ] } },
          "conditions": [ { "name": "caps_lock pressed", "type": "variable_if", "value": 1 } ],
          "to": [ { "key_code": "delete_or_backspace" } ],
          "type": "basic" },

        {
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "caps_lock pressed",
                "value": 1
              }
            }
          ],
          "to_after_key_up": [
            {
              "set_variable": {
                "name": "caps_lock pressed",
                "value": 0
              }
            }
          ],
          "to_if_alone": [
            {
              "key_code": "escape"
            }
          ],
          "type": "basic"
        }
      ]
    }
  ]
}

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2023-09-02 10:54:18
Processing time 0.0059 sec