如何仅对特定键盘布局(karabiner)启用规则? [英] How to enable rules only for specific keyboard layout (karabiner)?

查看:216
本文介绍了如何仅对特定键盘布局(karabiner)启用规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Karabiner的复杂修改设置下启用了多个规则,例如Emacs key bindings.

On Karabiner I am enabling multiples rules under its complex modifications setup, such as Emacs key bindings.

我想知道是否有可能仅针对特定键盘布局(例如U.S.)使用这些启用规则,并在我切换到其他键盘布局时自动禁用这些规则.

I was wondering is it possible to use those enables rules only for a specific keyboard layout such as U.S. and automatically disable those rules when I switch to an another keyboard layout.

推荐答案

来自此指南

看看 device_if示例条件文档


我在~/.config/karabiner/karabiner.json

{
    "manipulators": [
        {
            "conditions": [
                {
                    "input_sources": [
                        {
                            "language": "en"
                        }
                    ],
                    "type": "input_source_if"
                }
            ],

            "from": {
                "key_code": "open_bracket"
            },
            "to": [
                {
                    "key_code": "open_bracket",
                    "modifiers": [
                        "left_shift"
                    ]
                }
            ],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "input_sources": [
                        {
                            "language": "en"
                        }
                    ],
                    "type": "input_source_if"
                }
            ],
            "from": {
                "key_code": "close_bracket",
                "modifiers": {
                    "mandatory": [
                        "left_shift"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "close_bracket"
                }
            ],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "input_sources": [
                        {
                            "language": "en"
                        }
                    ],
                    "type": "input_source_if"
                }
            ],
            "from": {
                "key_code": "close_bracket"
            },
            "to": [
                {
                    "key_code": "close_bracket",
                    "modifiers": [
                        "left_shift"
                    ]
                }
            ],
            "type": "basic"
        },
        {
            "conditions": [
                {
                    "input_sources": [
                        {
                            "language": "en"
                        }
                    ],
                    "type": "input_source_if"
                }
            ],
            "from": {
                "key_code": "open_bracket",
                "modifiers": {
                    "mandatory": [
                        "left_shift"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "open_bracket"
                }
            ],
            "type": "basic"
        }
    ]
    }
},

这篇关于如何仅对特定键盘布局(karabiner)启用规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆