首页 » 工作 » 方法 » 正文

Fn + h/j/k/l/u/d/ to arrows and page scroll,Fn to Esc,CapsLock to Hyper

发布者:某某人
2019/07/4 浏览数(60) 分类:方法 暂无评论

概要

单按 CapsLock 还是 CapsLock,
组合时 CapsLock + g 等于 Ctrl + Shift + Option + Command + g
单按 Fn 是 Escape
组合时 Fn 还是 Fn
----
CapsLock -> Hyper
Fn -> Escape
Fn + h -> 左
Fn + j -> 下
Fn + k -> 上
Fn + l -> 右
Fn + u -> page up
Fn + d -> page down

用法

把 fn-capslock-enhancement.json 放到 ~/.config/karabiner/assets/complex_modifications/ 。

fn-capslock-enhancement.json 代码

{
  "title": "Fn/CapsLock Enhancement",
  "rules": [
    {
      "description": "Held CapsLock to Hyper",
      "manipulators": [
        {
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "right_control",
              "modifiers": ["right_command", "right_option", "right_shift"]
            }
          ],
          "to_if_alone": {
            "hold_down_milliseconds": 100,
            "key_code": "caps_lock"
          },
          "type": "basic"
        }
      ]
    },
    {
      "description": "Alone Fn to Escape",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "fn",
            "modifiers": {
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "fn",
              "lazy": true
            }
          ],
          "to_if_alone": [
            {
              "key_code": "escape"
            }
          ]
        }
      ]
    },
    {
      "description": "Fn + h/j/k/l to arrows",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "h",
            "modifiers": {
              "mandatory": ["fn"],
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "left_arrow"
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "j",
            "modifiers": {
              "mandatory": ["fn"],
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "down_arrow"
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "k",
            "modifiers": {
              "mandatory": ["fn"],
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "up_arrow"
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "l",
            "modifiers": {
              "mandatory": ["fn"],
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "right_arrow"
            }
          ]
        }
      ]
    },
    {
      "description": "Fn + u/d to page scroll",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "u",
            "modifiers": {
              "mandatory": ["fn"],
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "page_up"
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "d",
            "modifiers": {
              "mandatory": ["fn"],
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "page_down"
            }
          ]
        }
      ]
    }
  ]
}

到 Karabiner-Elements 中启用这些规则

规则在 complex_modifications 标签页中。

— 完 —

暂时木有评论啊,等您坐沙发呢!

发表评论

点击返回顶部
  1. 留言
  2. 联系方式