-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathhieroglyphs.py
More file actions
116 lines (112 loc) · 3.1 KB
/
hieroglyphs.py
File metadata and controls
116 lines (112 loc) · 3.1 KB
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
from source.custard import *
#ヒエログリフの文字のリストを取得
hieroglyphs = list(map(lambda x: chr(x), range(0x13000, 0x133FF+1)))
#キーのリストを作成
hieroglyphs_keys = [
KeyData(
specifier=GridScrollSpecifier(index=0),
key=SystemKey(SystemKeyType.change_keyboard)
),
KeyData(
specifier=GridScrollSpecifier(index=1),
key=CustomKey(
design=KeyDesign(
label=TextLabel(text="←"),
color=KeyColor.special
),
press_actions=[
MoveCursorAction(-1)
],
longpress_actions=LongpressAction(
repeat=[
MoveCursorAction(-1)
]
),
variations=[]
)
),
KeyData(
specifier=GridScrollSpecifier(index=2),
key=CustomKey(
design=KeyDesign(
label=TextLabel(text="→"),
color=KeyColor.special
),
press_actions=[
MoveCursorAction(1)
],
longpress_actions=LongpressAction(
repeat=[
MoveCursorAction(1)
]
),
variations=[]
)
),
KeyData(
specifier=GridScrollSpecifier(index=3),
key=CustomKey(
design=KeyDesign(
label=SystemImageLabel(identifier="list.bullet"),
color=KeyColor.special
),
press_actions=[
ToggleTabBarAction()
],
longpress_actions=LongpressAction(),
variations=[]
)
),
KeyData(
specifier=GridScrollSpecifier(index=4),
key=CustomKey(
design=KeyDesign(
label=SystemImageLabel(identifier="delete.left"),
color=KeyColor.special
),
press_actions=[
DeleteAction(1)
],
longpress_actions=LongpressAction(
repeat=[
MoveCursorAction(1)
]
),
variations=[]
)
),
]
for glyph in hieroglyphs:
key = CustomKey(
design=KeyDesign(
label=TextLabel(text=glyph),
color=KeyColor.normal
),
press_actions=[
InputAction(glyph)
],
longpress_actions=LongpressAction(),
variations=[]
)
keydata = KeyData(
specifier=GridScrollSpecifier(index=len(hieroglyphs_keys)),
key=key
)
hieroglyphs_keys.append(keydata)
#カスタードオブジェクトを作成
hieroglyphs_custard = Custard(
identifier="Hieroglyphs",
language=Language.none,
input_style=InputStyle.direct,
metadata=Metadata(
custard_version="1.0",
display_name="ヒエログリフ",
),
interface=Interface(
key_style=KeyStyle.tenkey_style,
key_layout=GridScrollLayout(
direction=ScrollDirection.vertical, row_count=8, column_count=4.2),
keys=hieroglyphs_keys
)
)
hieroglyphs_custard.write(name="hieroglyphs")