首页 > 系统服务 > 详细

macos键盘映射修改

时间:2020-09-13 15:13:37      阅读:71      评论:0      收藏:0      [点我收藏+]

在windows下,我使用AutoHotkey (AHK)进行键盘映射,AHK不支持macos,所以重新选了一款软件,这款软件是Karabiner-Elements

要把键位映射成什么样子?

如下图:

技术分享图片

这样基本就可以实现在编辑东西的时候不需要使用鼠标了。

配置Karabiner-Elements

进入目录~/.config/karabiner/assets/complex_modifications 中,新建一个my.json文件,写入如下内容:

{
    "title": "my_key_map",
    "rules": [
      {
        "description": "my_key_map",
        "manipulators": [
          {
            "type": "basic",
            "from": {  
              "key_code": "u",
              "modifiers": {
                "mandatory": [ "command" ], 
                "optional": [ "any" ]
              }
            },
            "to": [
              {
                "key_code": "left_arrow",
                "modifiers": [
                    "command"
                ]
              }
            ]
          },
          {
            "type": "basic",
            "from": {  
              "key_code": "y",
              "modifiers": {
                "mandatory": [ "command" ], 
                "optional": [ "any" ]
              }
            },
            "to": [
              {
                "key_code": "left_arrow",
                "modifiers": [
                    "command",
                    "shift"
                ]
              }
            ]
          },
          {
            "type": "basic",
            "from": {  
              "key_code": "i",
              "modifiers": {
                "mandatory": [ "command" ], 
                "optional": [ "any" ]
              }
            },
            "to": [
              {
                "key_code": "right_arrow",
                "modifiers": [
                    "command"
                ]
              }
            ]
          },
          {
            "type": "basic",
            "from": {  
              "key_code": "o",
              "modifiers": {
                "mandatory": [ "command" ], 
                "optional": [ "any" ]
              }
            },
            "to": [
              {
                "key_code": "right_arrow",
                "modifiers": [
                    "command",
                    "shift"
                ]
              }
            ]
          },
          {
            "type": "basic",
            "from": {  
              "key_code": "comma",
              "modifiers": {
                "mandatory": [ "command" ], 
                "optional": [ "any" ]
              }
            },
            "to": [
              {
                "key_code": "left_arrow",
                "modifiers": [
                    "shift"
                ]
              }
            ]
          },
          {
            "type": "basic",
            "from": {  
              "key_code": "period",
              "modifiers": {
                "mandatory": [ "command" ], 
                "optional": [ "any" ]
              }
            },
            "to": [
              {
                "key_code": "right_arrow",
                "modifiers": [
                    "shift"
                ]
              }
            ]
          },
          {
            "type": "basic",
            "from": {  
              "key_code": "d",
              "modifiers": {
                "mandatory": [ "command" ], 
                "optional": [ "any" ]
              }
            },
            "to": [
              {
                "key_code": "delete_forward"
              }
            ]
          }
        ]
      }
    ]
  }

然后在Add rule时就可以看到该配置项,Enable它即可。

配置文件说明

其实不需要太多说明,根据已有的配置文件猜一猜,改一改就可以了。

备注

各个键对应的英文名是什么?

可以在Karabiner-Elements的Simple modifications中看到。

macos键盘映射修改

原文:https://www.cnblogs.com/shanchuan/p/13661004.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!