pqrs-org / Karabiner-archived

Karabiner (KeyRemap4MacBook) is a powerful utility for keyboard customization.
https://pqrs.org/osx/karabiner/
The Unlicense
3.82k stars 311 forks source link

Custom modifier doesn't work with other native modifiers #891

Closed zheeeng closed 4 years ago

zheeeng commented 4 years ago

I tried change the CAPS_LOCK to F key to control the navigation but it doesn't work with SHIFT modifier. e.g.: CAPS_LOCK + SHIFT + i = expand the selection to left on one position F + SHIFT + i = input uppercased i to screen

{
  "title": "Use CAPS LOCK for vi navigation",
  "rules": [{
      "description": "CAPS LOCK + hjkl to arrow keys",
      "manipulators": [{
          "type": "basic",
          "from": {
            "key_code": "j",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [{
            "key_code": "down_arrow"
          }],
          "conditions": [{
            "type": "variable_if",
            "name": "caps_lock pressed",
            "value": 1
          }]
        }, {
          "type": "basic",
          "from": {
            "key_code": "k",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [{
            "key_code": "up_arrow"
          }],
          "conditions": [{
            "type": "variable_if",
            "name": "caps_lock pressed",
            "value": 1
          }]
        }, {
          "type": "basic",
          "from": {
            "key_code": "h",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [{
            "key_code": "left_arrow"
          }],
          "conditions": [{
            "type": "variable_if",
            "name": "caps_lock pressed",
            "value": 1
          }]
        }, {
          "type": "basic",
          "from": {
            "key_code": "l",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [{
            "key_code": "right_arrow"
          }],
          "conditions": [{
            "type": "variable_if",
            "name": "caps_lock pressed",
            "value": 1
          }]
        },
        {
          "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
            }
          }]
        }
      ]
    }
  ]
}