-
Notifications
You must be signed in to change notification settings - Fork 271
/
Copy pathscancode_map.kll
430 lines (386 loc) · 11.1 KB
/
scancode_map.kll
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
# TestIn Base Configuration
Name = TestIn;
Version = 0.4;
Author = "HaaTa (Jacob Alexander) 2016-2018";
# Modified Date
Date = 2018-10-11;
# Function Row
S0x01 : U"Esc";
S0x02 : U"F1";
S0x03 : U"F2";
S0x04 : U"F3";
S0x05 : U"F4";
S0x06 : U"F5";
S0x07 : U"F6";
S0x08 : U"F7";
S0x09 : U"F8";
S0x0A : U"F9";
S0x0B : U"F10";
S0x0C : U"F11";
S0x0D : U"F12";
S0x0E : U"PrintScreen";
S0x0F : U"ScrollLock";
S0x10 : U"Pause";
# Number Row
S0x11 : U"Backtick";
S0x12 : U"1";
S0x13 : U"2";
S0x14 : U"3";
S0x15 : U"4";
S0x16 : U"5";
S0x17 : U"6";
S0x18 : U"7";
S0x19 : U"8";
S0x1A : U"9";
S0x1B : U"0";
S0x1C : U"Minus";
S0x1D : U"Equals";
S0x1F : U"Backspace";
S0x21 : U"Insert";
S0x22 : U"Home";
S0x23 : U"PageUp";
# Top Alphabet Row
S0x24 : U"Tab";
S0x25 : U"Q";
S0x26 : U"W";
S0x27 : U"E";
S0x28 : U"R";
S0x29 : U"T";
S0x2A : U"Y";
S0x2B : U"U";
S0x2C : U"I";
S0x2D : U"O";
S0x2E : U"P";
S0x2F : U"LBrace";
S0x30 : U"RBrace";
S0x31 : U"Backslash";
S0x33 : U"Delete";
S0x34 : U"End";
S0x35 : U"PageDown";
# Middle Alphabet Row
S0x36 : U"CapsLock";
S0x37 : U"A";
S0x38 : U"S";
S0x39 : U"D";
S0x3A : U"F";
S0x3B : U"G";
S0x3C : U"H";
S0x3D : U"J";
S0x3E : U"K";
S0x3F : U"L";
S0x40 : U"Semicolon";
S0x41 : U"Quote";
S0x43 : U"Enter";
# Bottom Alphabet Row
S0x45 : U"LShift";
S0x47 : U"Z";
S0x48 : U"X";
S0x49 : U"C";
S0x4A : U"V";
S0x4B : U"B";
S0x4C : U"N";
S0x4D : U"M";
S0x4E : U"Comma";
S0x4F : U"Period";
S0x50 : U"Slash";
S0x52 : U"RShift";
S0x54 : U"Up";
# Modifier Row
S0x55 : U"LCtrl";
S0x56 : U"LGui";
S0x57 : U"LAlt";
S0x58 : U"Space";
S0x59 : U"RAlt";
S0x5A : U"RGui";
S0x5B : U"App";
S0x5C : U"RCtrl";
S0x5D : U"Left";
S0x5E : U"Down";
S0x5F : U"Right";
### Pixel Buffer Setup ###
# Defines channel mappings, changing the order will affect Pixel definitions
Pixel_Buffer_Size[] = 0 192; # Starting channel for each buffer
Pixel_Buffer_Width[] = 16 16; # Width of each channel buffer (may be different than effective channel size)
Pixel_Buffer_Length[] = 192 192; # Length of each buffer (count, not bytes)
Pixel_Buffer_Buffer[0] = "KLL_pageBuffer[0].buffer"; # Pointer to the start of the buffer
Pixel_Buffer_Buffer[1] = "KLL_pageBuffer[1].buffer";
LED_Buffer_Size[] = 0 192; # Starting channel for each buffer
LED_Buffer_Width[] = 16 16; # Width of each channel buffer (may be different than effective channel size)
LED_Buffer_Length[] = 192 192; # Length of each buffer (count, not bytes)
LED_Buffer_Buffer[0] = "LED_pageBuffer[0].buffer"; # Pointer to the start of the buffer
LED_Buffer_Buffer[1] = "LED_pageBuffer[1].buffer";
# I2C LED Struct Definition
LED_BufferStruct = "
typedef struct LED_Buffer {
uint16_t i2c_addr;
uint16_t reg_addr;
uint16_t ledctrl[0];
uint16_t unused[0];
uint16_t buffer[192];
} LED_Buffer;
volatile LED_Buffer LED_pageBuffer[ 2 ];
typedef struct KLL_Buffer {
uint16_t buffer[192];
} KLL_Buffer;
volatile KLL_Buffer KLL_pageBuffer[ 2 ];
";
### Pixel Mapping ###
# Organizes each of the channels into pixels (may, or may not be multi-channel)
# Function Row (1-16)
P[ 1]( 16:8, 0:8, 32:8) : S1;
P[ 2]( 17:8, 1:8, 33:8) : S2;
P[ 3]( 18:8, 2:8, 34:8) : S3;
P[ 4]( 19:8, 3:8, 35:8) : S4;
P[ 5]( 20:8, 4:8, 36:8) : S5;
P[ 6]( 21:8, 5:8, 37:8) : S6;
P[ 7]( 22:8, 6:8, 38:8) : S7;
P[ 8]( 23:8, 7:8, 39:8) : S8;
P[ 9]( 24:8, 8:8, 40:8) : S9;
P[ 10]( 25:8, 9:8, 41:8) : S10;
P[ 11]( 26:8, 10:8, 42:8) : S11;
P[ 12]( 27:8, 11:8, 43:8) : S12;
P[ 13]( 28:8, 12:8, 44:8) : S13;
P[ 14]( 29:8, 13:8, 45:8) : S14;
P[ 15]( 30:8, 14:8, 46:8) : S15;
P[ 16]( 31:8, 15:8, 47:8) : S16;
# Number Row (17-33)
P[ 17]( 64:8, 48:8, 80:8) : S17;
P[ 18]( 65:8, 49:8, 81:8) : S18;
P[ 19]( 66:8, 50:8, 82:8) : S19;
P[ 20]( 67:8, 51:8, 83:8) : S20;
P[ 21]( 68:8, 52:8, 84:8) : S21;
P[ 22]( 69:8, 53:8, 85:8) : S22;
P[ 23]( 70:8, 54:8, 86:8) : S23;
P[ 24]( 71:8, 55:8, 87:8) : S24;
P[ 25]( 72:8, 56:8, 88:8) : S25;
P[ 26]( 73:8, 57:8, 89:8) : S26;
P[ 27]( 74:8, 58:8, 90:8) : S27;
P[ 28]( 75:8, 59:8, 91:8) : S28;
P[ 29]( 76:8, 60:8, 92:8) : S29;
P[ 30]( 77:8, 61:8, 93:8) : S31;
P[ 31]( 78:8, 62:8, 94:8) : S33;
P[ 32]( 79:8, 63:8, 95:8) : S34;
P[ 33](112:8, 96:8, 128:8) : S35;
# Top Alpha Row (34-50)
P[ 34](113:8, 97:8, 129:8) : S36;
P[ 35](114:8, 98:8, 130:8) : S37;
P[ 36](115:8, 99:8, 131:8) : S38;
P[ 37](116:8, 100:8, 132:8) : S39;
P[ 38](117:8, 101:8, 133:8) : S40;
P[ 39](118:8, 102:8, 134:8) : S41;
P[ 40](119:8, 103:8, 135:8) : S42;
P[ 41](120:8, 104:8, 136:8) : S43;
P[ 42](121:8, 105:8, 137:8) : S44;
P[ 43](122:8, 106:8, 138:8) : S45;
P[ 44](123:8, 107:8, 139:8) : S46;
P[ 45](124:8, 108:8, 140:8) : S47;
P[ 46](125:8, 109:8, 141:8) : S48;
P[ 47](126:8, 110:8, 142:8) : S49;
P[ 48](127:8, 111:8, 143:8) : S51;
P[ 49](160:8, 144:8, 176:8) : S52;
P[ 50](161:8, 145:8, 177:8) : S53;
# Mid Alpha Row (51-63)
P[ 51](162:8, 146:8, 178:8) : S54;
P[ 52](163:8, 147:8, 179:8) : S55;
P[ 53](164:8, 148:8, 180:8) : S56;
P[ 54](165:8, 149:8, 181:8) : S57;
P[ 55](166:8, 150:8, 182:8) : S58;
P[ 56](167:8, 151:8, 183:8) : S59;
P[ 57](168:8, 152:8, 184:8) : S60;
P[ 58](169:8, 153:8, 185:8) : S61;
P[ 59](170:8, 154:8, 186:8) : S62;
P[ 60](171:8, 155:8, 187:8) : S63;
P[ 61](172:8, 156:8, 188:8) : S64;
P[ 62](173:8, 157:8, 189:8) : S65;
P[ 63](174:8, 158:8, 190:8) : S67;
# Low Alpha Row (64-76)
P[ 64](175:8, 159:8, 191:8) : S69;
P[ 65](208:8, 192:8, 224:8) : S71;
P[ 66](209:8, 193:8, 225:8) : S72;
P[ 67](210:8, 194:8, 226:8) : S73;
P[ 68](211:8, 195:8, 227:8) : S74;
P[ 69](212:8, 196:8, 228:8) : S75;
P[ 70](213:8, 197:8, 229:8) : S76;
P[ 71](214:8, 198:8, 230:8) : S77;
P[ 72](215:8, 199:8, 231:8) : S78;
P[ 73](216:8, 200:8, 232:8) : S79;
P[ 74](217:8, 201:8, 233:8) : S80;
P[ 75](218:8, 202:8, 234:8) : S82;
P[ 76](219:8, 203:8, 235:8) : S84;
# Mod Row (77-87)
P[ 77](220:8, 204:8, 236:8) : S85;
P[ 78](221:8, 205:8, 237:8) : S86;
P[ 79](222:8, 206:8, 238:8) : S87;
P[ 80](223:8, 207:8, 239:8) : S88;
P[ 81](256:8, 240:8, 272:8) : S89;
P[ 82](257:8, 241:8, 273:8) : S90;
P[ 83](258:8, 242:8, 274:8) : S91;
P[ 84](259:8, 243:8, 275:8) : S92;
P[ 85](260:8, 244:8, 276:8) : S93;
P[ 86](261:8, 245:8, 277:8) : S94;
P[ 87](262:8, 246:8, 278:8) : S95;
# Underlighting (88-119)
P[ 88](263:8, 247:8, 279:8) : None;
P[ 89](264:8, 248:8, 280:8) : None;
P[ 90](265:8, 249:8, 281:8) : None;
P[ 91](266:8, 250:8, 282:8) : None;
P[ 92](267:8, 251:8, 283:8) : None;
P[ 93](268:8, 252:8, 284:8) : None;
P[ 94](269:8, 253:8, 285:8) : None;
P[ 95](270:8, 254:8, 286:8) : None;
P[ 96](271:8, 255:8, 287:8) : None;
P[ 97](304:8, 288:8, 320:8) : None;
P[ 98](305:8, 289:8, 321:8) : None;
P[ 99](306:8, 290:8, 322:8) : None;
P[100](307:8, 291:8, 323:8) : None;
P[101](308:8, 292:8, 324:8) : None;
P[102](309:8, 293:8, 325:8) : None;
P[103](310:8, 294:8, 326:8) : None;
P[104](311:8, 295:8, 327:8) : None;
P[105](312:8, 296:8, 328:8) : None;
P[106](313:8, 297:8, 329:8) : None;
P[107](314:8, 298:8, 330:8) : None;
P[108](315:8, 299:8, 331:8) : None;
P[109](316:8, 300:8, 332:8) : None;
P[110](317:8, 301:8, 333:8) : None;
P[111](318:8, 302:8, 334:8) : None;
P[112](319:8, 303:8, 335:8) : None;
P[113](352:8, 336:8, 368:8) : None;
P[114](353:8, 337:8, 369:8) : None;
P[115](354:8, 338:8, 370:8) : None;
P[116](355:8, 339:8, 371:8) : None;
P[117](356:8, 340:8, 372:8) : None;
P[118](357:8, 341:8, 373:8) : None;
P[119](358:8, 342:8, 374:8) : None;
### Physical Positions ###
# Rows
S[1-16] <= y:0;
S[17-29,31,33-35] <= y:-19.05;
S[36-49,51-53] <= y:-38.1;
S[54-65,67] <= y:-57.15;
S[69-80,82,84] <= y:-76.2;
S[85-95] <= y:-95.25;
# Columns
S[ 1,17] <= x:0; # Esc, Tilde
S[87] <= x:2.38; # Left Ctrl
S[36] <= x:4.76; # Tab
S[54] <= x:7.14; # Caps Lock
S[69] <= x:11.9; # Left Shift
S[18] <= x:19.05; # Number 1
S[86] <= x:26.19; # Left Win
S[37] <= x:28.58; # Q
S[55] <= x:33.33; # A
S[ 2,19] <= x:38.1; # F1, Number 2
S[71] <= x:42.85; # Z
S[38] <= x:47.63; # W
S[87] <= x:50.00; # Left Alt
S[56] <= x:52.39; # S
S[20, 3] <= x:57.15; # F2, Number 3
S[72] <= x:61.91; # X
S[39] <= x:66.68; # E
S[57] <= x:71.44; # D
S[21, 4] <= x:76.2; # F3, Number 4
S[73] <= x:80.96; # C
S[40] <= x:85.73; # R
S[58] <= x:90.49; # F
S[22, 5] <= x:95.25; # F4, Number 5
S[74] <= x:100.00; # V
S[41] <= x:104.77; # T
S[59] <= x:109.54; # G
S[23] <= x:114.3; # Number 6
S[75] <= x:119.04; # B
S[88] <= x:121.44; # Spacebar
S[42, 6] <= x:123.83; # Y, F5
S[60] <= x:128.60; # H
S[24] <= x:133.35; # Number 7
S[76] <= x:138.10; # N
S[43, 7] <= x:142.88; # F6, U
S[61] <= x:147.64; # J
S[25] <= x:142.4; # Number 8
S[77] <= x:157.16; # M
S[ 8,44] <= x:161.93; # I
S[62] <= x:166.69; # K
S[26] <= x:171.45; # Number 9
S[78] <= x:176.21; # , <
S[45, 9] <= x:180.98; # O, F8
S[63] <= x:185.74; # L
S[27] <= x:190.5; # Number 0
S[89] <= x:192.88; # Right alt
S[79] <= x:195.26; # . >
S[46] <= x:200.02; # P
S[64] <= x:204.79; # ;
S[28,10] <= x:209.55; # -_, F9
S[80] <= x:214.31; # /?
S[90] <= x:216.69; # Right Win
S[47] <= x:219.07; # [ {
S[65] <= x:223.84; # ' "
S[11,29] <= x:228.6; # F10, =+
S[48] <= x:238.13; # ]}
S[91] <= x:240.50; # Menu/Fn
S[12] <= x:247.65; # F11
S[82] <= x:250.03; # Right Shift
S[67] <= x:254.06; # Enter
S[31] <= x:257.17; # Backspace
S[49] <= x:261.94; # \|
S[92] <= x:264.32; # Right CTRL
S[13] <= x:266.7; # F12
S[14,33,51,93] <= x:295.275; # Print screen, Insert, Delete, Left arrow
S[15,34,52,84,94] <= x:314.33; # Scroll lock, Home, End, Up arrow, Down arrow.
S[16,35,53,95] <= x:333.375; # Pause break, Page up, Page down, Right Arrow.
#
# Stand-alone LEDs
# See section 8.5 for more details
# Also use the pcb numbers, syntax is almost the same
# P is for Pixel
#
# Corners
P[88] <= x:-7.81, y:7.87; # Top Left
P[100] <= x:341.19, y:7.87; # Top Right
P[104] <= x:341.19, y:-112.52; # Bottom Right
P[116] <= x:-7.81, y:-112.52; # Bottom Left
# Top
P[89-99] <= y:10.54;
# Right
P[101-103] <= x:343.79;
# Bottom
P[105-115] <= y:-115.19;
# Left
P[117-119] <= x:-10.41;
# Starting top left, working around the LED's all the way around in a circle
P[89] <= x:21.20;
P[90] <= x:50.29;
P[91] <= x:79.38;
P[92] <= x:108.45;
P[93] <= x:137.54;
P[94] <= x:166.62;
P[95] <= x:195.70;
P[96] <= x:224.79;
P[97] <= x:253.87;
P[98] <= x:282.95;
P[99] <= x:312.03;
P[101] <= y:-22.23;
P[102] <= y:-52.32;
P[103] <= y:-82.42;
P[105] <= x:312.04;
P[106] <= x:282.96;
P[107] <= x:253.87;
P[108] <= x:224.79;
P[109] <= x:195.71;
P[110] <= x:166.62;
P[111] <= x:137.54;
P[112] <= x:108.46;
P[113] <= x:79.38;
P[114] <= x:50.29;
P[115] <= x:21.21;
P[116] <= y:-82.42;
P[117] <= y:-52.32;
P[118] <= y:-22.23;
### LED Default Fade Groups ###
#
# Group 0 -> Keys
# Group 1 -> Underlighting
# Group 2 -> Indicators
# Group 3 -> Active layer (not default)
KLL_LED_FadeGroup[0] = "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";
KLL_LED_FadeGroup[1] = "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";
KLL_LED_FadeGroup[2] = "";