-
Notifications
You must be signed in to change notification settings - Fork 3
/
keycodes
executable file
·796 lines (788 loc) · 10.6 KB
/
keycodes
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
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
# /usr/share/BasiliskII/keycodes
#
# Basilisk II (C) 1997-2005 Christian Bauer
#
# This file is used to translate the (server-specific) scancodes to
# Mac keycodes depending on the window server being used.
#
# The format of this file is as follows:
#
# sdl <driver string>
# <SDL scancode> <Mac keycode>
# <SDL scancode> <Mac keycode>
# <SDL scancode> <Mac keycode>
# ...
# sdl <driver string>
# <SDL scancode> <Mac keycode>
# <SDL scancode> <Mac keycode>
# ...
#
# The "driver string" must match the first part of the SDL driver vendor
# description as reported by SDL_VideoDriverName(). If a match is found,
# the keycode translation table is constructed from the following
# lines. Each line contains an SDL scancode followed by its associated
# Mac keycode. Both keycodes have to be given in decimal. Lines
# beginning with "#" or ";" are treated as comments and ignored.
#
#
# X11 server
# X.Org
#
sdl dga
The X.Org Foundation
9 53 # Esc
67 122 # F1
68 120 # F2
69 99 # F3
70 118 # F4
71 96 # F5
72 97 # F6
73 98 # F7
74 100 # F8
75 101 # F9
76 109 # F10
95 103 # F11
96 111 # F12
111 105 # PrintScrn
78 107 # Scroll Lock
110 113 # Pause
49 50 # `
10 18 # 1
11 19 # 2
12 20 # 3
13 21 # 4
14 23 # 5
15 22 # 6
16 26 # 7
17 28 # 8
18 25 # 9
19 29 # 0
20 27 # -
21 24 # =
22 51 # Backspace
106 114 # Insert
97 115 # Home
99 116 # Page Up
77 71 # Num Lock
112 75 # KP /
63 67 # KP *
82 78 # KP -
23 48 # Tab
24 12 # Q
25 13 # W
26 14 # E
27 15 # R
28 17 # T
29 16 # Y
30 32 # U
31 34 # I
32 31 # O
33 35 # P
34 33 # [
35 30 # ]
36 36 # Return
107 117 # Delete
103 119 # End
105 121 # Page Down
79 89 # KP 7
80 91 # KP 8
81 92 # KP 9
86 69 # KP +
66 57 # Caps Lock
38 0 # A
39 1 # S
40 2 # D
41 3 # F
42 5 # G
43 4 # H
44 38 # J
45 40 # K
46 37 # L
47 41 # ;
48 39 # '
83 86 # KP 4
84 87 # KP 5
85 88 # KP 6
50 56 # Shift Left
94 50 # International
52 6 # Z
53 7 # X
54 8 # C
55 9 # V
56 11 # B
57 45 # N
58 46 # M
59 43 # ,
60 47 # .
61 44 # /
62 56 # Shift Right
51 42 # \
98 62 # Cursor Up
87 83 # KP 1
88 84 # KP 2
89 85 # KP 3
108 76 # KP Enter
37 54 # Ctrl Left
115 58 # Logo Left (-> Option)
64 55 # Alt Left (-> Command)
65 49 # Space
113 55 # Alt Right (-> Command)
116 58 # Logo Right (-> Option)
109 54 # Ctrl Right
100 59 # Cursor Left
104 61 # Cursor Down
102 60 # Cursor Right
90 82 # KP 0
91 65 # KP .
#
# Linux Framebuffer Console
#
sdl fbcon
1 53 # Esc
59 122 # F1
60 120 # F2
61 99 # F3
62 118 # F4
63 96 # F5
64 97 # F6
65 98 # F7
66 100 # F8
67 101 # F9
68 109 # F10
87 103 # F11
88 111 # F12
99 105 # PrintScrn
70 107 # Scroll Lock
119 113 # Pause
41 50 # `
2 18 # 1
3 19 # 2
4 20 # 3
5 21 # 4
6 23 # 5
7 22 # 6
8 26 # 7
9 28 # 8
10 25 # 9
11 29 # 0
12 27 # -
13 24 # =
14 51 # Backspace
110 114 # Insert
102 115 # Home
104 116 # Page Up
69 71 # Num Lock
98 75 # KP /
55 67 # KP *
74 78 # KP -
15 48 # Tab
16 12 # Q
17 13 # W
18 14 # E
19 15 # R
20 17 # T
21 16 # Y
22 32 # U
23 34 # I
24 31 # O
25 35 # P
26 33 # [
27 30 # ]
28 36 # Return
111 117 # Delete
107 119 # End
109 121 # Page Down
71 89 # KP 7
72 91 # KP 8
73 92 # KP 9
78 69 # KP +
58 57 # Caps Lock
30 0 # A
31 1 # S
32 2 # D
33 3 # F
34 5 # G
35 4 # H
36 38 # J
37 40 # K
38 37 # L
39 41 # ;
40 39 # '
75 86 # KP 4
76 87 # KP 5
77 88 # KP 6
42 56 # Shift Left
86 50 # International
44 6 # Z
45 7 # X
46 8 # C
47 9 # V
48 11 # B
49 45 # N
50 46 # M
51 43 # ,
52 47 # .
53 44 # /
54 56 # Shift Right
43 42 # \
103 62 # Cursor Up
79 83 # KP 1
80 84 # KP 2
81 85 # KP 3
96 76 # KP Enter
29 54 # Ctrl Left
125 58 # Logo Left (-> Option)
56 55 # Alt Left (-> Command)
57 49 # Space
100 55 # Alt Right (-> Command)
126 58 # Logo Right (-> Option)
97 54 # Ctrl Right
105 59 # Cursor Left
108 61 # Cursor Down
106 60 # Cursor Right
82 82 # KP 0
83 65 # KP .
#
# Quartz (1:1 translation actually)
#
sdl Quartz
53 53 # Esc
122 122 # F1
120 120 # F2
99 99 # F3
118 118 # F4
96 96 # F5
97 97 # F6
98 98 # F7
100 100 # F8
101 101 # F9
109 109 # F10
103 103 # F11
111 111 # F12
105 105 # F13/PrintScrn
107 107 # F14/Scroll Lock
113 113 # F15/Pause
10 10 # `
18 18 # 1
19 19 # 2
20 20 # 3
21 21 # 4
23 23 # 5
22 22 # 6
26 26 # 7
28 28 # 8
25 25 # 9
29 29 # 0
27 27 # -
24 24 # =
51 51 # Backspace
114 114 # Help/Insert
115 115 # Home
116 116 # Page Up
71 71 # Num Lock
81 81 # KP =
75 75 # KP /
67 67 # KP *
48 48 # Tab
12 12 # Q
13 13 # W
14 14 # E
15 15 # R
17 17 # T
16 16 # Y
32 32 # U
34 34 # I
31 31 # O
35 35 # P
33 33 # [
30 30 # ]
36 36 # Return
117 117 # Delete
119 119 # End
121 121 # Page Down
89 89 # KP 7
91 91 # KP 8
92 92 # KP 9
78 78 # KP -
57 57 # Caps Lock
0 0 # A
1 1 # S
2 2 # D
3 3 # F
5 5 # G
4 4 # H
38 38 # J
40 40 # K
37 37 # L
41 41 # ;
39 39 # '
42 42 # \
86 86 # KP 4
87 87 # KP 5
88 88 # KP 6
69 69 # KP +
56 56 # Shift
50 50 # International
6 6 # Z
7 7 # X
8 8 # C
9 9 # V
11 11 # B
45 45 # N
46 46 # M
43 43 # ,
47 47 # .
44 44 # /
126 62 # Cursor Up
123 59 # Cursor Left
125 61 # Cursor Down
124 60 # Cursor Right
83 83 # KP 1
84 84 # KP 2
85 85 # KP 3
76 76 # KP Enter
54 54 # Ctrl
58 58 # Option
55 55 # Command
54 54 # Ctrl Left
49 49 # Space
82 82 # KP 0
65 65 # KP .
#
# Windows
#
sdl windib
sdl directx
1 53 # Esc
59 122 # F1
60 120 # F2
61 99 # F3
62 118 # F4
63 96 # F5
64 97 # F6
65 98 # F7
66 100 # F8
67 101 # F9
68 109 # F10
87 103 # F11
88 111 # F12
183 105 # PrintScrn
70 107 # Scroll Lock
197 113 # Pause
41 50 # `
2 18 # 1
3 19 # 2
4 20 # 3
5 21 # 4
6 23 # 5
7 22 # 6
8 26 # 7
9 28 # 8
10 25 # 9
11 29 # 0
12 27 # -
13 24 # =
14 51 # Backspace
210 114 # Insert
199 115 # Home
201 116 # Page Up
69 71 # Num Lock
181 75 # KP /
55 67 # KP *
74 78 # KP -
15 48 # Tab
16 12 # Q
17 13 # W
18 14 # E
19 15 # R
20 17 # T
21 16 # Y
22 32 # U
23 34 # I
24 31 # O
25 35 # P
26 33 # [
27 30 # ]
28 36 # Return
211 117 # Delete
207 119 # End
209 121 # Page Down
71 89 # KP 7
72 91 # KP 8
73 92 # KP 9
78 69 # KP +
58 57 # Caps Lock
30 0 # A
31 1 # S
32 2 # D
33 3 # F
34 5 # G
35 4 # H
36 38 # J
37 40 # K
38 37 # L
39 41 # ;
40 39 # '
75 86 # KP 4
76 87 # KP 5
77 88 # KP 6
42 56 # Shift Left
86 50 # International
44 6 # Z
45 7 # X
46 8 # C
47 9 # V
48 11 # B
49 45 # N
50 46 # M
51 43 # ,
52 47 # .
53 44 # /
54 56 # Shift Right
43 42 # \
200 62 # Cursor Up
79 83 # KP 1
80 84 # KP 2
81 85 # KP 3
156 76 # KP Enter
29 54 # Ctrl Left
219 58 # Logo Left (-> Option)
56 55 # Alt Left (-> Command)
57 49 # Space
184 55 # Alt Right (-> Command)
220 58 # Logo Right (-> Option)
157 54 # Ctrl Right
203 59 # Cursor Left
208 61 # Cursor Down
205 60 # Cursor Right
82 82 # KP 0
83 65 # KP .
#
# OSX/macOS (SDL2)
#
sdl cocoa
41 53 # Esc
58 122 # F1
59 120 # F2
60 99 # F3
61 118 # F4
62 96 # F5
63 97 # F6
64 98 # F7
65 100 # F8
66 101 # F9
67 109 # F10
68 103 # F11
69 111 # F12
70 105 # F13/PrintScrn
71 107 # F14/Scroll Lock
72 113 # F15/Pause
53 10 # `
30 18 # 1
31 19 # 2
32 20 # 3
33 21 # 4
34 23 # 5
35 22 # 6
36 26 # 7
37 28 # 8
38 25 # 9
39 29 # 0
45 27 # -
46 24 # =
42 51 # Backspace
73 114 # Help/Insert
74 115 # Home
75 116 # Page Up
83 71 # Num Lock
103 81 # KP =
84 75 # KP /
85 67 # KP *
43 48 # Tab
20 12 # Q
26 13 # W
8 14 # E
21 15 # R
23 17 # T
28 16 # Y
24 32 # U
12 34 # I
18 31 # O
19 35 # P
47 33 # [
48 30 # ]
40 36 # Return
76 117 # Delete
77 119 # End
78 121 # Page Down
95 89 # KP 7
96 91 # KP 8
97 92 # KP 9
86 78 # KP -
57 57 # Caps Lock
4 0 # A
22 1 # S
7 2 # D
9 3 # F
10 5 # G
11 4 # H
13 38 # J
14 40 # K
15 37 # L
51 41 # ;
52 39 # '
49 42 # \
92 86 # KP 4
93 87 # KP 5
94 88 # KP 6
87 69 # KP +
100 50 # International
29 6 # Z
27 7 # X
6 8 # C
25 9 # V
5 11 # B
17 45 # N
16 46 # M
54 43 # ,
55 47 # .
56 44 # /
82 62 # Cursor Up
80 59 # Cursor Left
81 61 # Cursor Down
79 60 # Cursor Right
89 83 # KP 1
90 84 # KP 2
91 85 # KP 3
88 76 # KP Enter
225 56 # Shift Left
224 54 # Ctrl Left
226 58 # Option Left
227 55 # Command Left
44 49 # Space
231 55 # Command Right
230 58 # Option Right
228 54 # Ctrl Right
229 56 # Shift Right
98 82 # KP 0
99 65 # KP .
#
# Windows (SDL2)
#
sdl windows
41 53 # Esc
58 122 # F1
59 120 # F2
60 99 # F3
61 118 # F4
62 96 # F5
63 97 # F6
64 98 # F7
65 100 # F8
66 101 # F9
67 109 # F10
68 103 # F11
69 111 # F12
70 105 # F13/PrintScrn
71 107 # F14/Scroll Lock
72 113 # F15/Pause
53 10 # `
30 18 # 1
31 19 # 2
32 20 # 3
33 21 # 4
34 23 # 5
35 22 # 6
36 26 # 7
37 28 # 8
38 25 # 9
39 29 # 0
45 27 # -
46 24 # =
42 51 # Backspace
73 114 # Help/Insert
74 115 # Home
75 116 # Page Up
83 71 # Num Lock
103 81 # KP =
84 75 # KP /
85 67 # KP *
43 48 # Tab
20 12 # Q
26 13 # W
8 14 # E
21 15 # R
23 17 # T
28 16 # Y
24 32 # U
12 34 # I
18 31 # O
19 35 # P
47 33 # [
48 30 # ]
40 36 # Return
76 117 # Delete
77 119 # End
78 121 # Page Down
95 89 # KP 7
96 91 # KP 8
97 92 # KP 9
86 78 # KP -
57 57 # Caps Lock
4 0 # A
22 1 # S
7 2 # D
9 3 # F
10 5 # G
11 4 # H
13 38 # J
14 40 # K
15 37 # L
51 41 # ;
52 39 # '
49 42 # \
92 86 # KP 4
93 87 # KP 5
94 88 # KP 6
87 69 # KP +
100 50 # International
29 6 # Z
27 7 # X
6 8 # C
25 9 # V
5 11 # B
17 45 # N
16 46 # M
54 43 # ,
55 47 # .
56 44 # /
82 62 # Cursor Up
80 59 # Cursor Left
81 61 # Cursor Down
79 60 # Cursor Right
89 83 # KP 1
90 84 # KP 2
91 85 # KP 3
88 76 # KP Enter
225 56 # Shift Left
224 58 # Ctrl Left (--> Option)
# 227 # Logo Left
226 55 # Alt Left (--> Command)
44 49 # Space
230 55 # Alt Right (--> Command)
# 231 # Logo Right
228 54 # Ctrl Right
229 56 # Shift Right
98 82 # KP 0
99 65 # KP .
# On ISO keyboards Alt Gr = Alt Right + Control Left
# this will translate to Option + Command
#
# Linux/X11 (SDL2)
#
sdl x11
41 53 # Esc
58 122 # F1
59 120 # F2
60 99 # F3
61 118 # F4
62 96 # F5
63 97 # F6
64 98 # F7
65 100 # F8
66 101 # F9
67 109 # F10
68 103 # F11
69 111 # F12
70 105 # F13/PrintScrn
71 107 # F14/Scroll Lock
72 113 # F15/Pause
53 10 # `
30 18 # 1
31 19 # 2
32 20 # 3
33 21 # 4
34 23 # 5
35 22 # 6
36 26 # 7
37 28 # 8
38 25 # 9
39 29 # 0
45 27 # -
46 24 # =
42 51 # Backspace
73 114 # Help/Insert
74 115 # Home
75 116 # Page Up
83 71 # Num Lock
103 81 # KP =
84 75 # KP /
85 67 # KP *
43 48 # Tab
20 12 # Q
26 13 # W
8 14 # E
21 15 # R
23 17 # T
28 16 # Y
24 32 # U
12 34 # I
18 31 # O
19 35 # P
47 33 # [
48 30 # ]
40 36 # Return
76 117 # Delete
77 119 # End
78 121 # Page Down
95 89 # KP 7
96 91 # KP 8
97 92 # KP 9
86 78 # KP -
57 57 # Caps Lock
4 0 # A
22 1 # S
7 2 # D
9 3 # F
10 5 # G
11 4 # H
13 38 # J
14 40 # K
15 37 # L
51 41 # ;
52 39 # '
49 42 # \
92 86 # KP 4
93 87 # KP 5
94 88 # KP 6
87 69 # KP +
100 50 # International
29 6 # Z
27 7 # X
6 8 # C
25 9 # V
5 11 # B
17 45 # N
16 46 # M
54 43 # ,
55 47 # .
56 44 # /
82 62 # Cursor Up
80 59 # Cursor Left
81 61 # Cursor Down
79 60 # Cursor Right
89 83 # KP 1
90 84 # KP 2
91 85 # KP 3
88 76 # KP Enter
225 56 # Shift Left
224 54 # Ctrl Left
227 58 # Logo Left (--> Option)
226 55 # Alt Left (--> Command)
44 49 # Space
230 55 # Alt Right (--> Command)
231 58 # Logo Right (--> Option)
228 54 # Ctrl Right
229 56 # Shift Right
98 82 # KP 0
99 65 # KP .