0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[mac+KarabinerElements] windows英語キーボード風日本語・英語切り替えのcomplex_modifications

Posted at

mac+英語キーボード利用時でもwindows風に左shift+caps_lockで日英切り替えをしたくて久々にKarabinerElementsいじったので備忘録。

ポイントはmanipulators.conditionsで、条件によってmodを実行させるかどうかを変更できる点。

{
    "profiles": [
        {
            "complex_modifications": {
                "rules": [
                    {
                        "description": "左shift+CapsLockで日本語/英語変換",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "caps_lock",
                                    "modifiers": {
                                        "mandatory": [
                                            "left_shift"
                                        ],
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "japanese_eisuu"
                                    }
                                ],
                                "conditions": [
                                    {
                                        "input_sources": [
                                            {
                                                "language": "ja"
                                            }
                                        ],
                                        "type": "input_source_if"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "key_code": "caps_lock",
                                    "modifiers": {
                                        "mandatory": [
                                            "left_shift"
                                        ],
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "japanese_kana"
                                    }
                                ],
                                "conditions": [
                                    {
                                        "input_sources": [
                                            {
                                                "language": "en"
                                            }
                                        ],
                                        "type": "input_source_if"
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    }   
                ]
            }
        }
    ]
}
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?