Skip to content

Instantly share code, notes, and snippets.

@yetone
Last active September 6, 2021 05:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yetone/b29b79b16fb8fec16dbbdc7f39702352 to your computer and use it in GitHub Desktop.
Save yetone/b29b79b16fb8fec16dbbdc7f39702352 to your computer and use it in GitHub Desktop.
Karabiner 通过 left shift 来切换中英文
{
"description": "Switch between zh-Hans <-> en (left_shift)",
"manipulators": [
{
"conditions": [
{
"input_sources": [
{
"language": "en"
}
],
"type": "input_source_if"
}
],
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift"
}
],
"to_if_alone": [
{
"select_input_source": {
"language": "zh-Hans"
}
}
],
"type": "basic"
},
{
"conditions": [
{
"input_sources": [
{
"language": "zh-Hans"
}
],
"type": "input_source_if"
}
],
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift"
}
],
"to_if_alone": [
{
"select_input_source": {
"language": "en"
}
}
],
"type": "basic"
}
]
}
@liukun
Copy link

liukun commented Apr 9, 2020

多谢!不过我这里只能切换输入法图标,但无法真正激活双拼。看官方说明 https://karabiner-elements.pqrs.org/docs/json/complex-modifications-manipulator-definition/to/select-input-source/ select_input_source对于中文输入法可能有问题,改成直接发送切换输入法的快捷键就可以了。

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