karabiner-elements Mac下实现按键全定制 capslox完美替代品

Introduction

一直使用的 Win 平台的 CAPSLock+ 巨好用, 但是换到 Mac 上只能使用对应的付费版本 Capslox, 付费也只是一年的更新, 最后一个免费版本在 Mac Monterey 版本系统上已经废掉.

经过万能的 Google & V2ex & Github, 终于找到一个可以代替 99% 功能的解决方案: karabiner-elements 一款复杂的按键映射工具!

Install

在这里插入图片描述
直接brew install

instructions

offical documents

Karabiner-Elements complex_modifications rules

自定义规则需要放在此目录下, 才能在 karabiner 中手动添加.

~/.config/karabiner/assets/complex_modifications/

注意使用这套规则时, 如果要外接键盘,需要将command键与option键互换,因为键盘一般是对应着 windows 的键位来的, win(也就是command) & alt(option) 与 mac是相反的.

code

{
   
  "title": "capslox - my",
  "version": "1.0.0",
  "rules": [
    {
   
      "description": "Capslock赋能",
      "manipulators": [
        {
   
          "description": "Capslock键设置为Hyper键",
          "type": "basic",
          "from": {
   
            "key_code": "caps_lock",
            "modifiers": {
   
              "optional": ["any"]
            }
          },
          "to": [
            {
   
              "key_code": "right_shift",
              "modifiers": ["right_command", "right_control", "right_option"]
            }
          ],
          "to_if_alone": [
            {
   
              "key_code": "caps_lock",
              "modifiers": ["left_control"]
            }
          ]
        },
        {
   
          "description": "Capslock + Esc = 切换大小写",
          "type": "basic",
          "from": {
   
            "key_code": "escape",
            "modifiers": {
   
              "optional": ["caps_lock"],
              "mandatory": [
                "right_command",
                "right_control",
                "right_shift",
                "right_option"
              ]
            }
          },
          "to": [
            {
   
              "key_code": "caps_lock",
              "modifiers": ["left_control"]
            }
          ]
        },
        {
   
          "description": "Capslock + SpaceBar = Enter",
          "type": "basic",
          "from": {
   
            "key_code": "spacebar",
            "modifiers": {
   
              "mandatory": [
                "right_command",
                "right_control",
                "right_shift",
                "right_option"
              ]
            }
          },
          "to": [
            {
   
              "key_code": "return_or_enter"
            }
          ]
        }
      ]
    },
    {
   
      "description": "光标移动",
      "manipulators": [
        {
   
          "from": {
   
            "description": "Capslock + E = 向上移动",
            "key_code": "e",
            "modifiers": {
   
              "mandatory": [
                "right_command",
                "right_control",
                "right_shift",
                "right_option"
              ]
            }
          },
          "to": [
            {
   
              "key_code": "up_arrow"
            }
          ],
          "type": "basic"
        },
        {
   
          "from": {
   
            "description": "Capslock + D = 向下移动",
            "key_code": "d",
            "modifiers": {
   
              "mandatory": [
                "right_command",
                "right_control",
                "right_shift",
                "right_option"
              ]
            }
          },
          "to": [
            {
   
              "key_code": "down_arrow"
            }
          ],
          "type": "basic"
        },
        {
   
          "from": {
   
            "description": "Capslock + S = 向左移动",
            "key_code": "s",
            "modifiers": {
   
              "mandatory": [
                "right_command",
                "right_control",
                "right_shift",
                "right_option"
              ]
            }
          },
          "to": [
            {
   
              "key_code": "left_arrow"
            }
          ],
          "type": "basic"
        },
        {
   
          "from": {
   
            "description": "Capslock + F = 向右移动",
            "key_code": "f",
            "modifiers": {
   
              "mandatory": [
                "right_command",
                "right_control",
                "right_shift",
                "right_option"
              ]
            }
          },
          "to": [
            {
   
              "key_code": "right_arrow"
            }
          ],
          "type": "basic"
        },
        {
   
          "from": {
   
            "description": "Capslock + A = 向左移动一个单词",
            "key_code": "a",
            "modifiers": {
   
              "mandatory": [
                "right_command",
                "right_control",
                "right_shift",
                "right_option"
              ]
            }
          },
          "to": [
            {
   
              "key_code": "left_arrow",
              "modifiers": <
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值