-
Notifications
You must be signed in to change notification settings - Fork 0
/
en_us.py
278 lines (274 loc) · 6.26 KB
/
en_us.py
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
# SPDX-FileCopyrightText: 2020, Bitboy85
#
# SPDX-License-Identifier: MIT
"""
=======================================================
# The index of the array represents the 8-bit ascii code.
# The tupple of each index represents the keys needed to be pressed for this ascii character
# For example: on german layouts @ is written by ALT_R(AltGr) + q
# keycodes of 0x00 are ignored, those represent non-printable chars or characters which cannot be entered by key combination
#
# Deadkeys: For characters which require some keypresses one after another, for example â is written on a german layout by
# pressing ^ followed by a just use a python list as keycode. so â is done with: "â" : [(0x35),(0x04)],
#
* Author(s): Bitboy85
"""
L_SHIFT = 0xE1
asciiToKeycode = [
(0x00), # NUL
(0x00), # SOH
(0x00), # STX
(0x00), # ETX
(0x00), # EOT
(0x00), # ENQ
(0x00), # ACK
(0x00), # BEL
(0x2a), # BS Backspace
(0x2b), # TAB Tab
(0x28), # LF Enter
(0x00), # VT
(0x00), # FF
(0x00), # CR
(0x00), # SO
(0x00), # SI
(0x00), # DEL
(0x00), # DC1
(0x00), # DC2
(0x00), # DC3
(0x00), # DC4
(0x00), # NAK
(0x00), # SYN
(0x00), # ETB
(0x00), # CAN
(0x00), # EM
(0x00), # SUB
(0x00), # ESC
(0x00), # FS
(0x00), # GS
(0x00), # RS
(0x00), # US
(0x2c), # SPACE
(0x1e, L_SHIFT), # !
(0x34, L_SHIFT), # "
(0x20, L_SHIFT), # #
(0x21, L_SHIFT), # $
(0x22, L_SHIFT), # %
(0x24, L_SHIFT), # &
(0x34), # '
(0x26, L_SHIFT), # (
(0x27, L_SHIFT), # )
(0x25, L_SHIFT), # *
(0x2e, L_SHIFT), # +
(0x36), # ,
(0x2d), # -
(0x37), # .
(0x38), # /
(0x27), # 0
(0x1e), # 1
(0x1f), # 2
(0x20), # 3
(0x21), # 4
(0x22), # 5
(0x23), # 6
(0x24), # 7
(0x25), # 8
(0x26), # 9
(0x33, L_SHIFT), # :
(0x33), # ;
(0x36, L_SHIFT), # <
(0x2e), # =
(0x37, L_SHIFT), # >
(0x38, L_SHIFT), # ?
(0x1f, L_SHIFT), # @
(0x04, L_SHIFT), # A
(0x05, L_SHIFT), # B
(0x06, L_SHIFT), # C
(0x07, L_SHIFT), # D
(0x08, L_SHIFT), # E
(0x09, L_SHIFT), # F
(0x0a, L_SHIFT), # G
(0x0b, L_SHIFT), # H
(0x0c, L_SHIFT), # I
(0x0d, L_SHIFT), # J
(0x0e, L_SHIFT), # K
(0x0f, L_SHIFT), # L
(0x10, L_SHIFT), # M
(0x11, L_SHIFT), # N
(0x12, L_SHIFT), # O
(0x13, L_SHIFT), # P
(0x14, L_SHIFT), # Q
(0x15, L_SHIFT), # R
(0x16, L_SHIFT), # S
(0x17, L_SHIFT), # T
(0x18, L_SHIFT), # U
(0x19, L_SHIFT), # V
(0x1a, L_SHIFT), # W
(0x1b, L_SHIFT), # X
(0x1c, L_SHIFT), # Y
(0x1d, L_SHIFT), # Z
(0x2f), # [
(0x31), # bslash
(0x30), # ]
(0x23, L_SHIFT), # ^
(0x2d, L_SHIFT), # _
(0x35), # `
(0x04), # a
(0x05), # b
(0x06), # c
(0x07), # d
(0x08), # e
(0x09), # f
(0x0a), # g
(0x0b), # h
(0x0c), # i
(0x0d), # j
(0x0e), # k
(0x0f), # l
(0x10), # m
(0x11), # n
(0x12), # o
(0x13), # p
(0x14), # q
(0x15), # r
(0x16), # s
(0x17), # t
(0x18), # u
(0x19), # v
(0x1a), # w
(0x1b), # x
(0x1c), # y
(0x1d), # z
(0x2f, L_SHIFT), # {
(0x31, L_SHIFT), # |
(0x30, L_SHIFT), # }
(0x35, L_SHIFT), # ~
(0x4c), # DEL
(0x00), # [not printable] in some docs shown as € symbol, but not so in python / latin-1
(0x00), # [not printable]
(0x00), # ‚
(0x00), # ƒ
(0x00), # „
(0x00), # …
(0x00), # †
(0x00), # ‡
(0x00), # ˆ
(0x00), # ‰
(0x00), # Š
(0x00), # ‹
(0x00), # Œ
(0x00), #
(0x00), # Ž
(0x00), # [not printable]
(0x00), # [not printable]
(0x00), # ‘
(0x00), # ’
(0x00), # “
(0x00), # ”
(0x00), # •
(0x00), # –
(0x00), # —
(0x00), # ˜
(0x00), # ™
(0x00), # š
(0x00), # ›
(0x00), # œ
(0x00), # [not printable]
(0x00), # ž
(0x00), # Ÿ
(0x00), # [not printable]
(0x00), # ¡
(0x00), # ¢
(0x00), # £
(0x00), # ¤
(0x00), # ¥
(0x00), # ¦
(0x00), # §
(0x00), # ¨
(0x00), # ©
(0x00), # ª
(0x00), # «
(0x00), # ¬
(0x00), # [not printable]
(0x00), # ®
(0x00), # ¯
(0x00), # °
(0x00), # ±
(0x00), # ²
(0x00), # ³
(0x00), # ´
(0x00), # µ
(0x00), # ¶
(0x00), # ·
(0x00), # ¸
(0x00), # ¹
(0x00), # º
(0x00), # »
(0x00), # ¼
(0x00), # ½
(0x00), # ¾
(0x00), # ¿
(0x00), # À
(0x00), # Á
(0x00), # Â
(0x00), # Ã
(0x00), # Ä
(0x00), # Å
(0x00), # Æ
(0x00), # Ç
(0x00), # È
(0x00), # É
(0x00), # Ê
(0x00), # Ë
(0x00), # Ì
(0x00), # Í
(0x00), # Î
(0x00), # Ï
(0x00), # Ð
(0x00), # Ñ
(0x00), # Ò
(0x00), # Ó
(0x00), # Ô
(0x00), # Õ
(0x00), # Ö
(0x00), # ×
(0x00), # Ø
(0x00), # Ù
(0x00), # Ú
(0x00), # Û
(0x00), # Ü
(0x00), # Ý
(0x00), # Þ
(0x00), # ß
(0x00), # à
(0x00), # á
(0x00), # â
(0x00), # ã
(0x00), # ä
(0x00), # å
(0x00), # æ
(0x00), # ç
(0x00), # è
(0x00), # é
(0x00), # ê
(0x00), # ë
(0x00), # ì
(0x00), # í
(0x00), # î
(0x00), # ï
(0x00), # ð
(0x00), # ñ
(0x00), # ò
(0x00), # ó
(0x00), # ô
(0x00), # õ
(0x00), # ö
(0x00), # ÷
(0x00), # ø
(0x00), # ù
(0x00), # ú
(0x00), # û
(0x00), # ü
(0x00), # ý
(0x00), # þ
(0x00) # ÿ
]