Skip to content

Instantly share code, notes, and snippets.

@songouyang
Created August 26, 2022 05:24
Show Gist options
  • Save songouyang/60630494c8288b6ddc36710f4209674e to your computer and use it in GitHub Desktop.
Save songouyang/60630494c8288b6ddc36710f4209674e to your computer and use it in GitHub Desktop.
karabiner elements 自定义切换输入法规则
{
"title": "自定义切换输入法规则",
"rules": [
{
"description": "HHKB left_control 切换中英文",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control"
}
],
"to_if_alone": [
{
"key_code": "f18"
}
],
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"description": "HHKB",
"product_id": 33
}
]
}
]
}
]
},
{
"description": "内置键盘 caps_lock 切换搜狗中英文",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"left_control"
]
}
},
"to_if_alone": [
{
"key_code": "f18"
}
],
"to_if_held_down": [
{
"key_code": "caps_lock"
}
],
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 400
},
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"description": "Apple Internal Keyboard",
"is_keyboard": true,
"product_id": 636
}
]
}
]
}
]
}
]
}
@songouyang
Copy link
Author

image

@songouyang
Copy link
Author

left control 切换自带拼音输入法

{
  "title": "自定义切换输入法规则",
  "rules": [
    {
      "description": "HHKB left_control 切换中英文",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "left_control",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_control"
            }
          ],
          "to_if_alone": [
            {
              "key_code": "caps_lock"
            }
          ],
          "conditions": [
            {
              "type": "device_if",
              "identifiers": [
                {
                  "description": "HHKB",
                  "product_id": 33
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment