How to configure the 'control' key to work as 'backspace' alone and also to as 'control' when combined with other key in karabiner?

huangapple go评论52阅读模式
英文:

How to configure the 'control' key to work as 'backspace' alone and also to as 'control' when combined with other key in karabiner?

问题

I'm trying to make the control key backspace when pressed alone and also work as left control when combined with another key (eg I use control h, j, k, l for up, down, left, right), any help? for some reason, it's not working how I designed it.

https://i.stack.imgur.com/2VIud.jpg

expecting: the control key to having multi-functionality with 'backspace' and 'control'

英文:

I'm trying to make the control key backspace when pressed alone and also work as left control when combined with another key ( eg I use control h,j,k,l for up down left right), any help? for some reason, it's not working how I designed it.

https://i.stack.imgur.com/2VIud.jpg

expecting: the control key to having multi-functionality with 'backspace' and 'control'

答案1

得分: 1

我搞清楚了,并制作了两个版本,'control'必须替换为'left_control':

第一个版本:

{
    "description": "按下单独时,control 为退格键",
    "manipulators": [
        {
            "from": {
                "key_code": "left_control",
                "modifiers": {
                    "optional": ["any"]
                }
            },
            "parameters": {
                "basic.to_if_alone_timeout_milliseconds": 300,
                "basic.to_if_held_down_threshold_milliseconds": 0
            },
            "to_if_alone": [
                {
                    "key_code": "delete_or_backspace"
                }
            ],
            "to_if_held_down": [
                {
                    "key_code": "left_control"
                }
            ],
            "type": "basic"
        }
    ]
}

第二个版本:

{
    "description": "将control按下时与其他键一起按下,单独按下时为退格键。",
    "manipulators": [
        {
            "type": "basic",
            "from": {
                "key_code": "left_control",
                "modifiers": {
                    "optional": ["any"]
                }
            },
            "to": [
                {
                    "key_code": "left_control"
                }
            ],
            "to_if_alone": [
                {
                    "key_code": "delete_or_backspace"
                }
            ]
        }
    ]
}

希望这对你有帮助。

英文:

I figured it out and made 2 versions 'control' had to be substituted for 'left_control':


{
                    "description": "control is backspace when pressed alone",
                    "manipulators": [
                        {
                            "from": {
                                "key_code": "left_control",
                                "modifiers": {
                                    "optional": [
                                        "any"
                                    ]
                                }
                            },
                            "parameters": {
                                "basic.to_if_alone_timeout_milliseconds": 300,
                                "basic.to_if_held_down_threshold_milliseconds":0
                            },
                            "to_if_alone": [
                                {
                                    "key_code": "delete_or_backspace"
                                }
                            ],
                            "to_if_held_down": [
                                {
                                    "key_code": "left_control"
                                }
                            ],
                            "type": "basic"
                        }
                    ]
                }




               {
                        "description": "Change control to control if pressed with other keys, to backspace if pressed alone.",
                        "manipulators": [
                            {
                                "type": "basic",
                                "from": {
                                    "key_code": "left_control",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_control"
                                    }
                                ],
                                "to_if_alone": [
                                    {
                                        "key_code": "delete_or_backspace"
                                    }
                                ]
                            }
                        ]
                    }

huangapple
  • 本文由 发表于 2023年4月10日 23:38:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/75978497.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定