首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Karabiner-元素将键映射到组合键。

Karabiner-元素将键映射到组合键。
EN

Stack Overflow用户
提问于 2020-07-31 15:25:07
回答 2查看 5.6K关注 0票数 5

我对卡拉巴赫很陌生。据我所知,这个程序可以改变键盘映射。我理解并能够使用“简单修改”从键“键”到“键”。

但是,如果我想将我的Home按钮重新映射到CTRL+LEFT_ARROW,我该如何做呢?

目前在MacOs Mojave上

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-07-31 16:17:08

打开~/.config/karabiner/karabiner.json编辑文件,从根级>“概要文件”> "complex_modifications“>参数:{. }下添加:

代码语言:javascript
复制
"rules": [
                    {
                        "description": "Home to Control Left",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "home"
                                },
                                "to": [
                                    {
                                        "key_code": "left_arrow",
                                        "modifiers": "control"
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {
                        "description": "End to Control Right",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "end"
                                },
                                "to": [
                                    {
                                        "key_code": "right_arrow",
                                        "modifiers": "control"
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    }
                ]

请注意,这将显示:

  • CTRL+LEFT
  • END to CTRL+RIGHT
票数 6
EN

Stack Overflow用户

发布于 2022-09-18 16:06:54

~/.config/karabiner/line.json创建为:

代码语言:javascript
复制
{
  "title": "Line-related mappings",
  "rules": [
    {
      "description": "Home to Cmd+Left: Move to line start",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "home",
            "modifiers": {
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": "command"
            }
          ]
        }
      ]
    },
    {
      "description": "Shift+Home to Shift+Cmd+Left: Select to line start",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "home",
            "modifiers": {
              "mandatory": [
                "shift"
              ],
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "shift",
                "command"
              ]
            }
          ]
        }
      ]
    },
    {
      "description": "End to Cmd+Right: Move to line end",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "end",
            "modifiers": {
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": "command"
            }
          ]
        }
      ]
    },
    {
      "description": "Shift+End to Shift+Cmd+Right: Select to line end",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "end",
            "modifiers": {
              "mandatory": [
                "shift"
              ],
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": [
                "shift",
                "command"
              ]
            }
          ]
        }
      ]
    }
  ]
}

然后在卡拉巴赫,转到Preferences ->复合修改-> Add Rules -> All。

以上和其他内容可以在https://github.com/noel-yap/karabiner中找到。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63194740

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档