首页 > 解决方案 > Karabiner-Elements 将键映射到组合键

问题描述

我是新来的卡拉宾。据我了解,该程序可以更改键盘映射。我理解并且能够使用“简单修改”“从键”“到键”。

但是如果我想将我的主页按钮重新映射到 CTRL+LEFT_ARROW 我该怎么做呢?

目前在 MacOs Mojave

标签: macosmacos-mojavekarabiner

解决方案


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

"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"
                            }
                        ]
                    }
                ]

请注意,这将映射:

  • HOME 到 CTRL+LEFT
  • END 到 CTRL+RIGHT

推荐阅读