-
Notifications
You must be signed in to change notification settings - Fork 14
/
combo_pinyin_layouts.yaml
272 lines (246 loc) · 7.44 KB
/
combo_pinyin_layouts.yaml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# 宮保拼音鍵盤佈局
pc_layout_options:
# 字母表,包含用於並擊的按鍵
# 擊鍵雖有先後,形成並擊時,一律以字母表順序排列
alphabet: 'swxdecfrvgtbjum kiloaqzhynp'
# 拼寫運算規則,將一組並擊編碼轉換爲拼音音節
algebra:
# 先將物理按鍵字符對應到宮保拼音鍵位中的拼音字母
- 'xlit|swxdecfrvgtbjum kiloaqzhynp|SCZHLFGDBKTPIUVANREOXXXXXXX|'
# 以下根據宮保拼音的鍵位分別變換聲母、韻母部分
# 空格鍵單擊時產生空白
- 'xform/^A$/ /'
# 消除無效按鍵
- xform/X+//
pc_layout_initials:
algebra/+:
# 並擊聲母
- xform/^ZF/zh/
- xform/^CL/ch/
- xform/^FB/m/
- xform/^LD/n/
- xform/^HG/r/
# 特殊配列鍵盤用
- xform/^ZB/p/
- xform/^CD/t/
- xform/^SG/k/
split_layout_options:
# 字母表,包含用於並擊的按鍵
# 擊鍵雖有先後,形成並擊時,一律以字母表順序排列
alphabet: 'swxdecfrvgtbajum kiloqzhynp'
# 拼寫運算規則,將一組並擊編碼轉換爲拼音音節
algebra:
# 若 Control/Alt/Shift 鍵參與並擊,須改以單個字符表示按鍵
- 'xform/\{Control_L\}/a/'
- 'xform/\{Alt_L\}/a/'
- 'xform/\{Shift_L\}/a/'
# 將物理按鍵字符對應到宮保拼音鍵位中的拼音字母
- "xlit|swxdecfrvgtba;'jum kiloqzhynp|SCZCLFZDBGTPHJQIUVANREOXXXXXX|"
# 以下根據宮保拼音的鍵位分別變換聲母、韻母部分
# 分號、單引號較少用,改爲通過並擊組合輸入
- "xform/^JR$/;/"
- "xform/^QR$/'/"
# 若左手拇指鍵爲分號或單引號,改寫爲 H
- xlit|JQ|HH|
# 空格鍵單擊時發送空白
- 'xform/^A$/ /'
# 消除無效按鍵
- xform/X+//
- xform/H+/H/
split_layout_initials:
algebra/+:
# 並擊聲母
- xform/^BH/p/
- xform/^DH/t/
- xform/^GH/k/
- xform/^FB/m/
- xform/^LD/n/
- xform/^CZ/r/
# PC鍵盤增補聲母
- xform/^[ZCS]B/p/
- xform/^[ZCS]D/t/
- xform/^[ZCS]G/k/
- xform/^[ZCS]Z/zh/
# 兼容大衆式
- xform/^ZF/zh/
- xform/^CL/ch/
- xform/^SC/sh/
common_options:
algebra/+:
- xlit/BPFDTLGKHZCS/bpfdtlgkhzcs/
# G,K,H 接 I/Ü 作 ⟨ji/ju, qi/qu, xi/xu⟩
# 若分尖團,也可用 Z,C,S 與 I/Ü 相拼
- xform/^[gz]([IV])/j$1/
- xform/^[kc]([IV])/q$1/
- xform/^[hs]([IV])/x$1/
# ⟨er⟩自成音節
- xform/^R$/er/
# 舌尖元音⟨ï⟩
- xform/^([zcsr]h?)R?$/$1i/
- xform/ANE$/ang/
- xform/UARO$/uang/
- xform/IRO$/iong/
- xform/URO$/ong/
- xform/VNE$/iong/
- xform/UNE$/ong/
- xform/INE$/ing/
- xform/NE$/eng/
- xform/AN$/an/
- xform/VN$/vn/
- xform/UN$/uen/
- xform/IN$/in/
- xform/N$/en/
- xform/IAR$/iao/
- xform/IR$/iou/
- xform/UR$/uei/
- xform/AO$/ao/
- xform/RO$/ou/
- xform/AR$/ai/
- xform/RE?$/ei/
- xform/AE$/a/
- xlit/AOEIUV/aoeiuv/
# 漢語拼音方案的拼寫規則
- xform/^i(ng?)$/yi$1/
- xform/^i$/yi/
- xform/^i/y/
- xform/^ong$/weng/
- xform/^u$/wu/
- xform/^u/w/
- xform/^v/yu/
- xform/^([jqx])v/$1u/
# 一些容錯
- xform/^([bpmf])uo$/$1o/
- xform/^([dtngkhzcsr]h?)o$/$1uo/
- xform/io$/iao/
- xform/^([nl])uei$/$1ei/
- xform/^([nl])iong$/$1ong/
- xform/^([zcsr]h?)i([aoe])/$1$2/
- xform/^([zcsr]h?)i(ng?)$/$1e$2/
# 拼寫規則
- xform/iou$/iu/
- xform/uei$/ui/
- xform/uen$/un/
# 聲母獨用時補足隠含的韻母
# ⟨bu, pu, fu⟩
- xform/^([bpf])$/$1u/
# ⟨de, te, ne, le, ge, ke, he⟩
# 特別地,⟨me⟩ 對應常用字「麼·么」
- xform/^([mdtnlgkh])$/$1e/
# 並擊完成後套用的式樣
output_format:
# 追加隔音符號
- "xform/^([bpm])([iu]|a|i?e|o|[ae]i|i?ao|[oi]u|i?an|[ie]n|[ei]ng|ang|ong)$/$1$2'/"
- "xform/^([fw])(u|a|o|[ae]i|ao|ou|an|en|eng|ang|ong)$/$1$2'/"
- "xform/^([dt])([iu]|i?a|i?e|uo|[aeu]i|i?ao|[oi]u|[iu]?an|[ue]n|[ei]ng|ang|ong)$/$1$2'/"
- "xform/^([nl])([iuv]|i?a|[iv]?e|u?o|[aeu]i|i?ao|[oi]u|[iu]?an|[iue]n|[ei]ng|i?ang|ong)$/$1$2'/"
- "xform/^([gkh])(u|u?a|e|uo|u?ai|[ue]i|ao|ou|u?an|[ue]n|eng|u?ang|ong)$/$1$2'/"
- "xform/^([zcs]h?|r)([iu]|u?a|e|uo|u?ai|[ue]i|ao|ou|u?an|[ue]n|eng|u?ang|ong)$/$1$2'/"
- "xform/^([jqxy])([iu]|i?a|[iu]?e|o|i?ao|[oi]u|[iu]?an|[iu]n|ing|i?ang|i?ong)$/$1$2'/"
- "xform/^([aeo]|[ae]i|ao|ou|[ae]ng?|er)$/$1'/"
# 消除不構成合法音節的並擊組合
- "erase/^([A-Za-z+]+)$/"
# 並擊過程中套用的式樣
prompt_format:
# 加方括弧
- 'xform/^(.*)$/[$1]/'
# 適配 alpha28 以及類似配列的鍵盤,如 3×10 直列、Hummingbird
#
# Alpha28 配列
#
# Q W E R T Y U I O P
# A S D F G H J K L *
# Z X C V ___ B N M
#
# Hummingbird 配列
#
# Q W E R T Y U I O P
# A S D F G H J K L Z
# X C V B N M
# * * _ *
#
# 該配列 B, N, M 三鍵向右側移動,指法改變,故
# 1. 改用 B 鍵輸入宮保拼音的 [Ü]
# 2. 聲母⟨p⟩改用 [ZB] 並擊
use_alpha28_layout:
chord_composer/alphabet: 'swxdecfrvgtjub kiloaqzhynmp'
chord_composer/algebra/@0: 'xlit|swxdecfrvgtjub kiloaqzhynmp|SCZHLFGDBKTIUVANREOXXXXXXXX|'
# 補丁模板
# 補丁文件:combo_pinyin.custom.yaml
# 若直接修改輸入方案文件,則不需要第一級 `patch` 節點
#
# 用法示例:選用八指禪佈局,左 Control 鍵用作 H
# patch:
# __patch:
# - combo_pinyin_layouts:/use_split_layout
# - combo_pinyin_layouts:/use_control
#
# 用法示例:選用七指禪佈局,適配 alpha28 配列
# patch:
# __patch:
# - combo_pinyin_layouts:/use_pc_layout
# - combo_pinyin_layouts:/use_alpha28_layout
#
# 用法示例:選用七指禪佈局,啓用縮略碼;回車鍵上屏按鍵序列(須重設)
# patch:
# __patch:
# - combo_pinyin_layouts:/use_pc_layout_with_briefs
# - combo_pinyin_layouts:/use_return_to_commit_raw_input
use_pc_layout:
chord_composer/+:
__patch:
- pc_layout_options
- pc_layout_initials
- common_options
use_pc_layout_with_briefs:
chord_composer/+:
__patch:
- pc_layout_options
- combo_pinyin_briefs:/briefs
- pc_layout_initials
- common_options
use_split_layout:
chord_composer/+:
__patch:
- split_layout_options
- split_layout_initials
- common_options
use_return_to_commit_raw_input:
chord_composer/bindings:
# 回車鍵上屏按鍵序列
Return: commit_raw_input
use_return_to_confirm:
chord_composer/bindings:
# 不看回車鍵,讓 editor 處理
Return: noop
# 改用 Shift+回車上屏按鍵序列
Shift+Return: commit_raw_input
editor/bindings:
# 退格鍵刪除一個拼音音節
BackSpace: back_syllable
# 回車鍵確認當前候選
Return: confirm
use_semicolon:
chord_composer/+:
alphabet: 'swxdecfrvgtba;jum kiloqzhynp'
use_apostrophe:
chord_composer/+:
alphabet: "swxdecfrvgtba'jum kiloqzhynp"
use_control:
chord_composer/+:
alphabet: 'swxdecfrvgtba{Control_L}jum kiloqzhynp'
use_control: true
use_alt:
chord_composer/+:
alphabet: 'swxdecfrvgtba{Alt_L}jum kiloqzhynp'
use_alt: true
use_shift:
chord_composer/+:
alphabet: 'swxdecfrvgtba{Shift_L}jum kiloqzhynp'
use_shift: true
# 若左 Shift 鍵用於並擊則禁止其切換中西文
ascii_composer:
__include: default:/ascii_composer
switch_key/+:
Shift_L: noop
# 禁用大寫字母等模式匹配
recognizer: {}