zoukankan      html  css  js  c++  java
  • macos键盘映射修改

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

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

    如下图:

    映射图

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

    配置Karabiner-Elements

    vi方式的上下左右使用官网带的(Add rule->import from internet)就可以了。其余的我自己创造一下。

    进入目录~/.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中看到。

  • 相关阅读:
    使用 ReplicationHandler 设置一个中继器(Repeater)
    SpringSource通过Spring for Android 1.0将Spring Framework引入到Android上
    Lotus Quickr 8.5.1 for Domino 中目录服务的配置详解
    Pdf文件编辑攻略
    Android 4.1最终版SDK和ADT Plugin全线发布
    JXL copySheet 的一个BUG
    Spring Mobile 1.0发布
    jQuery 1.8、1.9与2.0特性概览,2.0将移除对IE6/7/8的支持
    Regsvr32命令修复IE 重装IE
    系统性分析性能问题与调优方法
  • 原文地址:https://www.cnblogs.com/shanchuan/p/13661004.html
Copyright © 2011-2022 走看看