-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhamster.yaml
668 lines (654 loc) · 20.2 KB
/
hamster.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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
# 通用配置
general:
enableAppleCloud: false
regexOnCopyFile:
# - ^.*[.]userdb.*$
# - ^.*build.*$
# - ^.*SharedSupport.*$
# - ^.*[.]bin$
# 工具栏
toolbar:
# 是否开启工具栏
enableToolbar: true
# 显示键盘 icon 按钮
displayAppIconButton: false
# 显示键盘 dissmiss 按钮
displayKeyboardDismissButton: false
# 工具栏总高度
heightOfToolbar: 50
# 拼写区高度(剩余高度由候选文字占用)
heightOfCodingArea: 10
# 拼写区字体大小
codingAreaFontSize: 12
# 候选文字字体大小
candidateWordFontSize: 18
# 候选文字备注信息字体大小。
# 对应 rime 候选字的 comment 信息
candidateCommentFontSize: 12
# 是否显示候选文字索引
displayIndexOfCandidateWord: false
# 是否显示候选文字 Comment 信息
displayCommentOfCandidateWord: false
# 键盘相关配置
keyboard:
# 使用键盘类型:
# chinese: 中文26键
# chineseNineGrid: 中文九宫格
# custom(name): 自定义键盘,其中 name 对应自定义键盘配置(customizeKeyboards)中的 name。如: custom(中文26键)
# useKeyboardType: chinese
useKeyboardType: custom(ZH)
# 关闭划动文本显示
disableSwipeLabel: false
# 上下显示划动文本不规则布局
swipeLabelUpAndDownIrregularLayout: false
# 上下显示划动文本规则布局
swipeLabelUpAndDownLayout: false
# 上划显示到左侧
upSwipeOnLeft: true
# 显示按键气泡
displayButtonBubbles: true
# 启用按键声
enableKeySounds: true
# 启用触控反馈
enableHapticFeedback: false
# 反馈强度
hapticFeedbackIntensity: 3
# 启用分号按键
displaySemicolonButton: false
# 启用符号按键
displayClassifySymbolButton: false
# 启用空格左侧按键
displaySpaceLeftButton: false
spaceLeftButtonProcessByRIME: true
keyValueOfSpaceLeftButton: ","
# 启用空格右侧按键
displaySpaceRightButton: false
spaceRightButtonProcessByRIME: true
keyValueOfSpaceRightButton: "."
# 启用中英切换按键
displayChineseEnglishSwitchButton: false
# 按键位于空格左侧
chineseEnglishSwitchButtonIsOnLeftOfSpaceButton: false
# 启用数字九宫格键盘
enableNineGridOfNumericKeyboard: true
# (数字九宫格键盘)符号是否直接上屏
enterDirectlyOnScreenByNineGridOfNumericKeyboard: true
symbolsOfGridOfNumericKeyboard:
- +
- "-"
- "*"
- /
lockShiftState: true
enableEmbeddedInputMode: false
widthOfOneHandedKeyboard: 80
symbolsOfCursorBack:
- '""'
- "“”"
- "[]"
symbolsOfReturnToMainKeyboard:
- ","
- "。"
- "!"
symbolsOfChineseNineGridKeyboard:
- ","
- "。"
- "?"
- "!"
- "…"
- "~"
- "'"
- "、"
pairsOfSymbols:
- "[]"
- ()
- "“”"
enableSymbolKeyboard: true
lockForSymbolKeyboard: false
# 是否启用空格加载文本
enableLoadingTextForSpaceButton: true
# 空格按钮加载文本
loadingTextForSpaceButton: ""
# 空格按钮长显文本
labelTextForSpaceButton: ""
# 空格按钮长显为当前输入方案
# 当开启此选项后,labelForSpaceButton 设置的值无效
showCurrentInputSchemaNameForSpaceButton: false
# 空格按钮加载文字显示当前输入方案
# 当开启此选项后, loadingTextForSpaceButton 设置的值无效
showCurrentInputSchemaNameOnLoadingTextForSpaceButton: false
# 是否启用配色方案
enableColorSchema: false
# 浅色模式下配色
useColorSchemaForLight: ""
# 暗色模式下配色
useColorSchemaForDark: ""
# 配色方案
# 来源: https://github.com/rime/squirrel/blob/master/data/squirrel.yaml
colorSchemas:
- schemaName: darksys
name: 暗色方案
author: weearc
back_color: "0x212121"
button_back_color: "0x212121"
button_pressed_back_color: "0x545454"
button_front_color: "0xBDBDBD"
button_pressed_front_color: "0xBDBDBD"
button_swipe_front_color: "0xBDBDBD"
corner_radius: 0
border_color: "0x212121"
text_color: "0xBDBDBD"
hilited_candidate_back_color: "0x545454"
hilited_candidate_text_color: "0xBDBDBD"
hilited_comment_text_color: "0xBDBDBD"
candidate_text_color: "0xBDBDBD"
comment_text_color: "0xBDBDBD"
# RIME 引擎相关配置
rime:
maximumNumberOfCandidateWords: 100
keyValueOfSwitchSimplifiedAndTraditional: zh_simp_s2t
# RIME 重新部署时,是否覆盖词库文件
# 如果使用自造词,需要改为 false, 否则部署时会覆盖键盘自造词文件
overrideDictFiles: false
# 覆盖词库文件的正则表达式
# 使用场景:
# 在开启 overrideDictFiles 后,每次重新部署会按照正则表达式符合的条件翻盖文件
regexOnOverrideDictFiles:
- "^.*[.]userdb.*$"
- "^.*[.]txt$"
# 拷贝键盘文件至应用沙盒目录的正则表达式,只会拷贝并覆盖符合表达式的文件。
# 正则表达式为空时,则使用默认值 ["^.*[.]userdb.*$", "^.*[.]txt$"]
# 使用场景:在文件管理功能中,拷贝键盘词库文件至应用
regexOnCopyAppGroupDictFile:
- "^.*[.]userdb.*$"
- "^.*[.]txt$"
# 划动相关配置
swipe:
# 指空格移动多个 point,光标移动一位。所以数字越小越灵敏
spaceDragSensitivity: 5
# 划动距离阈值,当划动的距离大于或等于此值时,才会识别为一次划动
distanceThreshold: 20
# 此值是正切角度的阈值,用来限制上下左右划动时的角度,如果太大容易误触
# 默认为 15 度的正切值,即上下左右划的的角度不能超过 15 度
# tan(10º) ≈ 0.176, tan(15º) ≈ 0.268, tan(30º) ≈ 0.577, tan(45º) = 1, tan(60º) ≈ 1.732
tangentThreshold: 0.577
# 长按延迟时间,只要大于或等于此阈值,才会触发长按 Action,如空格划动
longPressDelay: 0.3
keyboardSwipe:
# 中文 26 键滑动设置
- keyboardType: chinese
keys:
- action: character(a)
swipe:
- direction: up
action: character(`)
processByRIME: true
display: true
- direction: down
action: character(~)
processByRIME: true
display: false
- action: character(b)
swipe:
- direction: up
action: symbol(《》)
- direction: down
action: character(。)
display: false
- action: character(c)
swipe:
- direction: up
action: character(.)
- direction: down
action: character(>)
display: false
- action: character(d)
swipe:
- direction: up
action: character(=)
- direction: down
action: character(+)
display: false
- action: character(e)
swipe:
- direction: up
action: character(3)
# - direction: down
# action: character(#)
# display: false
- direction: down
action: keyboardType(alphabetic)
display: false
- action: character(f)
swipe:
- direction: up
action: character([)
- direction: down
action: character({)
display: false
- action: character(g)
swipe:
- direction: up
action: character(])
- direction: down
action: character(})
display: false
- action: character(h)
swipe:
- direction: up
action: character(\)
- direction: down
action: character(|)
display: false
- action: character(i)
swipe:
- direction: up
action: character(8)
- direction: down
action: character(*)
display: false
- action: character(j)
swipe:
- direction: up
action: character(/)
- direction: down
action: character(?)
display: false
- action: character(k)
swipe:
- direction: up
action: character(;)
- direction: down
action: character(:)
display: false
- action: character(l)
swipe:
- direction: up
action: character(')
- direction: down
action: character(")
display: false
- action: character(m)
swipe:
- direction: up
action: shortCommand(#行尾)
- direction: down
action: character(、)
display: false
- action: character(n)
swipe:
- direction: up
action: symbol(『』)
- direction: down
action: character(、)
display: false
- action: character(o)
swipe:
- direction: up
action: character(9)
- direction: down
action: character(()
display: false
- action: character(p)
swipe:
- direction: up
action: character(0)
- direction: down
action: character())
display: false
- action: character(q)
swipe:
- direction: up
action: character(1)
- direction: down
action: character(!)
display: false
- action: character(r)
swipe:
- direction: up
action: character(4)
- direction: down
action: character($)
display: false
- action: character(s)
swipe:
- direction: up
action: character(-)
- direction: down
action: character(_)
display: false
- action: character(t)
swipe:
- direction: up
action: character(5)
- direction: down
action: character(%)
display: false
- action: character(u)
swipe:
- direction: up
action: character(7)
- direction: down
action: character(&)
display: false
- action: character(v)
swipe:
- direction: up
action: symbol(“”)
- direction: down
action: character(,)
display: false
- action: character(w)
swipe:
- direction: up
action: character(2)
- direction: down
action: character(@)
display: false
- action: character(x)
swipe:
- direction: up
action: character(,)
- direction: down
action: character(<)
display: false
- action: character(y)
swipe:
- direction: up
action: character(6)
- direction: down
action: character(^)
display: false
- action: character(z)
swipe:
- direction: up
action: shortCommand(#行首)
- direction: down
action: symbol(‘’)
display: false
- action: space
swipe:
- direction: up
action: shortCommand(#次选上屏)
display: false
- action: enter
swipe:
- direction: up
action: shortCommand(#换行)
display: false
- action: backspace
swipe:
- direction: up
action: shortCommand(#重输)
display: false
- action: keyboardType(numericNineGrid)
swipe:
- direction: up
action: shortCommand(#上个输入方案)
display: false
# 中文九宫格滑动设置
- keyboardType: chineseNineGrid
keys:
- action: chineseNineGrid(@/.)
swipe:
- direction: up
action: character(1)
display: true
- action: chineseNineGrid(ABC)
swipe:
- direction: up
action: character(2)
display: true
- action: chineseNineGrid(DEF)
swipe:
- direction: up
action: character(3)
display: true
- action: chineseNineGrid(GHI)
swipe:
- direction: up
action: character(4)
display: true
- action: chineseNineGrid(JKL)
swipe:
- direction: up
action: character(5)
display: true
- action: chineseNineGrid(MNO)
swipe:
- direction: up
action: character(6)
display: true
- action: chineseNineGrid(PQRS)
swipe:
- direction: up
action: character(7)
display: true
- action: chineseNineGrid(TUV)
swipe:
- direction: up
action: character(8)
display: true
- action: chineseNineGrid(WXYZ)
swipe:
- direction: up
action: character(9)
display: true
# 自定义键盘布局
# 布局文档说明文档:https://github.com/imfuxiao/Hamster/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E9%94%AE%E7%9B%98%E5%B8%83%E5%B1%80
keyboards:
- name: ZH
rows:
- keys:
- action: character(q)
width: percentage(0.1)
- action: character(w)
width: percentage(0.1)
- action: character(e)
width: percentage(0.1)
- action: character(r)
width: percentage(0.1)
- action: character(t)
width: percentage(0.1)
- action: character(y)
width: percentage(0.1)
- action: character(u)
width: percentage(0.1)
- action: character(i)
width: percentage(0.1)
- action: character(o)
width: percentage(0.1)
- action: character(p)
width: percentage(0.1)
- keys:
- action: none
width: available
- action: character(a)
width: percentage(0.1)
- action: character(s)
width: percentage(0.1)
- action: character(d)
width: percentage(0.1)
- action: character(f)
width: percentage(0.1)
- action: character(g)
width: percentage(0.1)
- action: character(h)
width: percentage(0.1)
- action: character(j)
width: percentage(0.1)
- action: character(k)
width: percentage(0.1)
- action: character(l)
width: percentage(0.1)
- action: none
width: available
- keys:
- action: shift
width: percentage(0.13)
- action: none
width: available
- action: character(z)
width: percentage(0.1)
- action: character(x)
width: percentage(0.1)
- action: character(c)
width: percentage(0.1)
- action: character(v)
width: percentage(0.1)
- action: character(b)
width: percentage(0.1)
- action: character(n)
width: percentage(0.1)
- action: character(m)
width: percentage(0.1)
- action: none
width: available
- action: backspace
width: percentage(0.13)
- keys:
- action: keyboardType(numericNineGrid)
width:
portrait: percentage(0.15)
landscape: percentage(0.2)
- action: keyboardType(custom(EN))
label: ""
width:
portrait: percentage(0.08)
landscape: percentage(0.1)
- action: character(,)
width:
portrait: percentage(0.09)
landscape: percentage(0.1)
- action: space
label: "Clover"
width: available
- action: character(。)
width:
portrait: percentage(0.09)
landscape: percentage(0.1)
- action: enter
width:
portrait: percentage(0.14)
landscape: percentage(0.1)
buttonInsets: left(0),bottom(0),top(0),right(0)
- name: EN
rows:
- keys:
- action: character(q)
processByRIME: false
width: percentage(0.1)
- action: character(w)
processByRIME: false
width: percentage(0.1)
- action: character(e)
processByRIME: false
width: percentage(0.1)
- action: character(r)
processByRIME: false
width: percentage(0.1)
- action: character(t)
processByRIME: false
width: percentage(0.1)
- action: character(y)
processByRIME: false
width: percentage(0.1)
- action: character(u)
processByRIME: false
width: percentage(0.1)
- action: character(i)
processByRIME: false
width: percentage(0.1)
- action: character(o)
processByRIME: false
width: percentage(0.1)
- action: character(p)
processByRIME: false
width: percentage(0.1)
- keys:
- action: none
width: available
- action: character(a)
processByRIME: false
width: percentage(0.1)
- action: character(s)
processByRIME: false
width: percentage(0.1)
- action: character(d)
processByRIME: false
width: percentage(0.1)
- action: character(f)
processByRIME: false
width: percentage(0.1)
- action: character(g)
processByRIME: false
width: percentage(0.1)
- action: character(h)
processByRIME: false
width: percentage(0.1)
- action: character(j)
processByRIME: false
width: percentage(0.1)
- action: character(k)
processByRIME: false
width: percentage(0.1)
- action: character(l)
processByRIME: false
width: percentage(0.1)
- action: none
width: available
- keys:
- action: shift
width: percentage(0.13)
- action: none
width: available
- action: character(z)
processByRIME: false
width: percentage(0.1)
- action: character(x)
processByRIME: false
width: percentage(0.1)
- action: character(c)
processByRIME: false
width: percentage(0.1)
- action: character(v)
processByRIME: false
width: percentage(0.1)
- action: character(b)
processByRIME: false
width: percentage(0.1)
- action: character(n)
processByRIME: false
width: percentage(0.1)
- action: character(m)
processByRIME: false
width: percentage(0.1)
- action: none
width: available
- action: backspace
width: percentage(0.13)
- keys:
- action: keyboardType(numericNineGrid)
width:
portrait: percentage(0.15)
landscape: percentage(0.2)
- action: keyboardType(custom(ZH))
label: "EN"
width:
portrait: percentage(0.08)
landscape: percentage(0.1)
- action: character(,)
width:
portrait: percentage(0.09)
landscape: percentage(0.1)
- action: space
label: "Clover"
width: available
- action: character(.)
width:
portrait: percentage(0.09)
landscape: percentage(0.1)
- action: enter
width:
portrait: percentage(0.14)
landscape: percentage(0.1)
buttonInsets: left(0),bottom(0),top(0),right(0)