forked from SanseroGames/LetsGo-OS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeycodes.go
103 lines (99 loc) · 1.32 KB
/
keycodes.go
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
package main
var KeycodeTranslation = map[int]uint8{
0: 42,
0x1E: 0x41,
}
var test = map[uint8]string{
0: "0",
0x1E: "a",
}
// TODO: Maps don't work? they should though?
func translateKeycode(code uint8) uint8 {
switch code {
case 0x02:
return 0x31
case 0x03:
return 0x32
case 0x04:
return 0x33
case 0x05:
return 0x34
case 0x06:
return 0x35
case 0x07:
return 0x36
case 0x08:
return 0x37
case 0x09:
return 0x38
case 0x0a:
return 0x39
case 0x0b:
return 0x30
case 0x10:
return 0x71
case 0x11:
return 0x77
case 0x12:
return 0x65
case 0x13:
return 0x72
case 0x14:
return 0x74
case 0x15:
return 0x7a
case 0x16:
return 0x75
case 0x17:
return 0x69
case 0x18:
return 0x6f
case 0x19:
return 0x70
case 0x1E:
return 0x61
case 0x1f:
return 0x73
case 0x20:
return 0x64
case 0x21:
return 0x66
case 0x22:
return 0x67
case 0x23:
return 0x68
case 0x24:
return 0x6a
case 0x25:
return 0x6b
case 0x26:
return 0x6c
case 0x2c:
return 0x79
case 0x2d:
return 0x78
case 0x2e:
return 0x63
case 0x2f:
return 0x76
case 0x30:
return 0x62
case 0x31:
return 0x6e
case 0x32:
return 0x6d
case 0x33:
return 0x2c
case 0x34:
return 0x2e
case 0x35:
return 0x2d
case 0x39:
return 0x20
case 0x1C:
return '\n'
case 0x0E:
return '\b'
}
return 0
}