-
Notifications
You must be signed in to change notification settings - Fork 0
/
A simple solution to solve the "CJK input method switching" problem in Karabiner
109 lines (108 loc) · 5.22 KB
/
A simple solution to solve the "CJK input method switching" problem in Karabiner
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// 先打开中/英切换(系统偏好设置>键盘>输入法>使用大写锁定键切换“ABC”输入模式)
// 核心思路是先切换输入法,再通过caps键去刷新。
// 以下演示的是 简体中文双拼/简体中文五笔/繁体中文双拼/英文切换的脚本。
// 注:我手头的macbook pro是中国大陆地区发行的2021款16寸 m1 max 64GB 运行Monterey12.3(karabiner14.4.0),我不确定其他地区的发行版是否也有这个功能,也没有验证在其他的版本上是否能正常运行。
{
"description": "中文输入法切换",
"manipulators": [
{
"from": {
"key_code": "a",
"modifiers": {
"mandatory": [
"fn"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.keylayout\\.ABC$"
}
}
],
"type": "basic"
},
{
"from": {
"key_code": "w",
"modifiers": {
"mandatory": [
"fn"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.inputmethod\\.SCIM\\.WBX$",
"language": "zh*"
}
},
{
"key_code": "caps_lock"
}
],
"to_after_key_up": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
},
{
"from": {
"key_code": "s",
"modifiers": {
"mandatory": [
"fn"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.inputmethod\\.SCIM\\.Shuangpin$",
"language": "zh*"
}
},
{
"key_code": "caps_lock"
}
],
"to_after_key_up": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
},
{
"from": {
"key_code": "d",
"modifiers": {
"mandatory": [
"fn"
]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "^com\\.apple\\.inputmethod\\.TCIM\\.Shuangpin$",
"language": "zh*"
}
},
{
"key_code": "caps_lock"
}
],
"to_after_key_up": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
}
]
}