MacBookPro 键盘映射

    作为一个码农,带TouchBar的键盘只有虚拟ESC。只好映射一下,下边的`当ESC不错。同时把caps_lock映射成Ctrl。

那么ctrl+`改为`, shift+`改成~

1.安装karabiner。

2.设置karabiner属性里的simple modifications增加caps_lock to left_control

3.增加脚本

vim ~/.config/karabiner/assets/complex_modifications/1541404156.json

{
"title": "Change ctrl+` is `",
  "rules": [
 {
      "description": "Change grave accent and tilde to escape",
      "manipulators": [
        {
          "type": "basic",
          "from": {
              "key_code": "grave_accent_and_tilde"
          },
          "to": [
            {
              "key_code": "escape"
            }
          ]
        }
      ]
    },
   {
      "description": "change left_control + escape to accent`",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "grave_accent_and_tilde",
            "modifiers": {
                "mandatory":[
                        "left_control"
                ],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "grave_accent_and_tilde"
            }
          ]
        }
      ]
    },
{
      "description": "Change shift escape to grave accent and tilde",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "grave_accent_and_tilde",
                "mandatory":[
                        "left_shift"
                ],
"modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "grave_accent_and_tilde",
                "mandatory":[
                        "left_shift"
                ]
            }
          ]
        }
      ]
    },
    {
      "description": "Change caps_lock to control if pressed with other keys, to escape if pressed alone.",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_control"
            }
          ],
          "to_if_alone": [
            {
              "key_code": "escape"
            }
          ]
        }
      ]
    },
    {
      "description": "Change caps_lock to control if pressed with other keys. (rev 2)",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_control"
            }
          ],
          "to_if_alone": [
            {
              "key_code": "caps_lock",
              "hold_down_milliseconds": 500
            }
          ]
        }
      ]
    }
  ]
}

4.在Complex Modification中增加前三个。Over

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值