Rev 1838 | Rev 1842 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1838 | Rev 1841 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (C) 2006 Jakub Jermar |
2 | * Copyright (C) 2006 Jakub Jermar |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
8 | * |
8 | * |
9 | * - Redistributions of source code must retain the above copyright |
9 | * - Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * - Redistributions in binary form must reproduce the above copyright |
11 | * - Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
13 | * documentation and/or other materials provided with the distribution. |
14 | * - The name of the author may not be used to endorse or promote products |
14 | * - The name of the author may not be used to endorse or promote products |
15 | * derived from this software without specific prior written permission. |
15 | * derived from this software without specific prior written permission. |
16 | * |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup genarch |
29 | /** @addtogroup genarch |
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | /** |
32 | /** |
33 | * @file |
33 | * @file |
34 | * @brief Scan codes for pc keyboards. |
34 | * @brief Scan codes for pc keyboards. |
35 | */ |
35 | */ |
36 | 36 | ||
37 | #include <genarch/i8042/i8042.h> |
37 | #include <genarch/i8042/i8042.h> |
38 | 38 | ||
39 | /** Primary meaning of scancodes. */ |
39 | /** Primary meaning of scancodes. */ |
40 | char sc_primary_map[] = { |
40 | char sc_primary_map[] = { |
41 | SPECIAL, /* 0x00 */ |
41 | SPECIAL, /* 0x00 */ |
42 | SPECIAL, /* 0x01 - Esc */ |
42 | SPECIAL, /* 0x01 - Esc */ |
43 | '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', |
43 | '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', |
44 | '\b', /* 0x0e - Backspace */ |
44 | '\b', /* 0x0e - Backspace */ |
45 | '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', |
45 | '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', |
46 | SPECIAL, /* 0x1d - LCtrl */ |
46 | SPECIAL, /* 0x1d - LCtrl */ |
47 | 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', |
47 | 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', |
48 | '`', |
48 | '`', |
49 | SPECIAL, /* 0x2a - LShift */ |
49 | SPECIAL, /* 0x2a - LShift */ |
50 | '\\', |
50 | '\\', |
51 | 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', |
51 | 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', |
52 | SPECIAL, /* 0x36 - RShift */ |
52 | SPECIAL, /* 0x36 - RShift */ |
53 | '*', |
53 | '*', |
54 | SPECIAL, /* 0x38 - LAlt */ |
54 | SPECIAL, /* 0x38 - LAlt */ |
55 | ' ', |
55 | ' ', |
56 | SPECIAL, /* 0x3a - CapsLock */ |
56 | SPECIAL, /* 0x3a - CapsLock */ |
57 | SPECIAL, /* 0x3b - F1 */ |
57 | SPECIAL, /* 0x3b - F1 */ |
58 | SPECIAL, /* 0x3c - F2 */ |
58 | SPECIAL, /* 0x3c - F2 */ |
59 | SPECIAL, /* 0x3d - F3 */ |
59 | SPECIAL, /* 0x3d - F3 */ |
60 | SPECIAL, /* 0x3e - F4 */ |
60 | SPECIAL, /* 0x3e - F4 */ |
61 | SPECIAL, /* 0x3f - F5 */ |
61 | SPECIAL, /* 0x3f - F5 */ |
62 | SPECIAL, /* 0x40 - F6 */ |
62 | SPECIAL, /* 0x40 - F6 */ |
63 | SPECIAL, /* 0x41 - F7 */ |
63 | SPECIAL, /* 0x41 - F7 */ |
64 | SPECIAL, /* 0x42 - F8 */ |
64 | SPECIAL, /* 0x42 - F8 */ |
65 | SPECIAL, /* 0x43 - F9 */ |
65 | SPECIAL, /* 0x43 - F9 */ |
66 | SPECIAL, /* 0x44 - F10 */ |
66 | SPECIAL, /* 0x44 - F10 */ |
67 | SPECIAL, /* 0x45 - NumLock */ |
67 | SPECIAL, /* 0x45 - NumLock */ |
68 | SPECIAL, /* 0x46 - ScrollLock */ |
68 | SPECIAL, /* 0x46 - ScrollLock */ |
69 | '7', '8', '9', '-', |
69 | '7', '8', '9', '-', |
70 | '4', '5', '6', '+', |
70 | '4', '5', '6', '+', |
71 | '1', '2', '3', |
71 | '1', '2', '3', |
72 | '0', '.', |
72 | '0', '.', |
73 | SPECIAL, /* 0x54 - Alt-SysRq */ |
73 | SPECIAL, /* 0x54 - Alt-SysRq */ |
74 | SPECIAL, /* 0x55 - F11/F12/PF1/FN */ |
74 | SPECIAL, /* 0x55 - F11/F12/PF1/FN */ |
75 | SPECIAL, /* 0x56 - unlabelled key next to LAlt */ |
75 | SPECIAL, /* 0x56 - unlabelled key next to LAlt */ |
76 | SPECIAL, /* 0x57 - F11 */ |
76 | SPECIAL, /* 0x57 - F11 */ |
77 | SPECIAL, /* 0x58 - F12 */ |
77 | SPECIAL, /* 0x58 - F12 */ |
78 | SPECIAL, /* 0x59 */ |
78 | SPECIAL, /* 0x59 */ |
79 | SPECIAL, /* 0x5a */ |
79 | SPECIAL, /* 0x5a */ |
80 | SPECIAL, /* 0x5b */ |
80 | SPECIAL, /* 0x5b */ |
81 | SPECIAL, /* 0x5c */ |
81 | SPECIAL, /* 0x5c */ |
82 | SPECIAL, /* 0x5d */ |
82 | SPECIAL, /* 0x5d */ |
83 | SPECIAL, /* 0x5e */ |
83 | SPECIAL, /* 0x5e */ |
84 | SPECIAL, /* 0x5f */ |
84 | SPECIAL, /* 0x5f */ |
85 | SPECIAL, /* 0x60 */ |
85 | SPECIAL, /* 0x60 */ |
86 | SPECIAL, /* 0x61 */ |
86 | SPECIAL, /* 0x61 */ |
87 | SPECIAL, /* 0x62 */ |
87 | SPECIAL, /* 0x62 */ |
88 | SPECIAL, /* 0x63 */ |
88 | SPECIAL, /* 0x63 */ |
89 | SPECIAL, /* 0x64 */ |
89 | SPECIAL, /* 0x64 */ |
90 | SPECIAL, /* 0x65 */ |
90 | SPECIAL, /* 0x65 */ |
91 | SPECIAL, /* 0x66 */ |
91 | SPECIAL, /* 0x66 */ |
92 | SPECIAL, /* 0x67 */ |
92 | SPECIAL, /* 0x67 */ |
93 | SPECIAL, /* 0x68 */ |
93 | SPECIAL, /* 0x68 */ |
94 | SPECIAL, /* 0x69 */ |
94 | SPECIAL, /* 0x69 */ |
95 | SPECIAL, /* 0x6a */ |
95 | SPECIAL, /* 0x6a */ |
96 | SPECIAL, /* 0x6b */ |
96 | SPECIAL, /* 0x6b */ |
97 | SPECIAL, /* 0x6c */ |
97 | SPECIAL, /* 0x6c */ |
98 | SPECIAL, /* 0x6d */ |
98 | SPECIAL, /* 0x6d */ |
99 | SPECIAL, /* 0x6e */ |
99 | SPECIAL, /* 0x6e */ |
100 | SPECIAL, /* 0x6f */ |
100 | SPECIAL, /* 0x6f */ |
101 | SPECIAL, /* 0x70 */ |
101 | SPECIAL, /* 0x70 */ |
102 | SPECIAL, /* 0x71 */ |
102 | SPECIAL, /* 0x71 */ |
103 | SPECIAL, /* 0x72 */ |
103 | SPECIAL, /* 0x72 */ |
104 | SPECIAL, /* 0x73 */ |
104 | SPECIAL, /* 0x73 */ |
105 | SPECIAL, /* 0x74 */ |
105 | SPECIAL, /* 0x74 */ |
106 | SPECIAL, /* 0x75 */ |
106 | SPECIAL, /* 0x75 */ |
107 | SPECIAL, /* 0x76 */ |
107 | SPECIAL, /* 0x76 */ |
108 | SPECIAL, /* 0x77 */ |
108 | SPECIAL, /* 0x77 */ |
109 | SPECIAL, /* 0x78 */ |
109 | SPECIAL, /* 0x78 */ |
110 | SPECIAL, /* 0x79 */ |
110 | SPECIAL, /* 0x79 */ |
111 | SPECIAL, /* 0x7a */ |
111 | SPECIAL, /* 0x7a */ |
112 | SPECIAL, /* 0x7b */ |
112 | SPECIAL, /* 0x7b */ |
113 | SPECIAL, /* 0x7c */ |
113 | SPECIAL, /* 0x7c */ |
114 | SPECIAL, /* 0x7d */ |
114 | SPECIAL, /* 0x7d */ |
115 | SPECIAL, /* 0x7e */ |
115 | SPECIAL, /* 0x7e */ |
116 | SPECIAL, /* 0x7f */ |
116 | SPECIAL, /* 0x7f */ |
117 | }; |
117 | }; |
118 | 118 | ||
119 | /** Secondary meaning of scancodes. */ |
119 | /** Secondary meaning of scancodes. */ |
120 | char sc_secondary_map[] = { |
120 | char sc_secondary_map[] = { |
121 | SPECIAL, /* 0x00 */ |
121 | SPECIAL, /* 0x00 */ |
122 | SPECIAL, /* 0x01 - Esc */ |
122 | SPECIAL, /* 0x01 - Esc */ |
123 | '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', |
123 | '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', |
124 | SPECIAL, /* 0x0e - Backspace */ |
124 | SPECIAL, /* 0x0e - Backspace */ |
125 | '\t', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', |
125 | '\t', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', |
126 | SPECIAL, /* 0x1d - LCtrl */ |
126 | SPECIAL, /* 0x1d - LCtrl */ |
127 | 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', |
127 | 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', |
128 | '~', |
128 | '~', |
129 | SPECIAL, /* 0x2a - LShift */ |
129 | SPECIAL, /* 0x2a - LShift */ |
130 | '|', |
130 | '|', |
131 | 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', |
131 | 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', |
132 | SPECIAL, /* 0x36 - RShift */ |
132 | SPECIAL, /* 0x36 - RShift */ |
133 | '*', |
133 | '*', |
134 | SPECIAL, /* 0x38 - LAlt */ |
134 | SPECIAL, /* 0x38 - LAlt */ |
135 | ' ', |
135 | ' ', |
136 | SPECIAL, /* 0x3a - CapsLock */ |
136 | SPECIAL, /* 0x3a - CapsLock */ |
137 | SPECIAL, /* 0x3b - F1 */ |
137 | SPECIAL, /* 0x3b - F1 */ |
138 | SPECIAL, /* 0x3c - F2 */ |
138 | SPECIAL, /* 0x3c - F2 */ |
139 | SPECIAL, /* 0x3d - F3 */ |
139 | SPECIAL, /* 0x3d - F3 */ |
140 | SPECIAL, /* 0x3e - F4 */ |
140 | SPECIAL, /* 0x3e - F4 */ |
141 | SPECIAL, /* 0x3f - F5 */ |
141 | SPECIAL, /* 0x3f - F5 */ |
142 | SPECIAL, /* 0x40 - F6 */ |
142 | SPECIAL, /* 0x40 - F6 */ |
143 | SPECIAL, /* 0x41 - F7 */ |
143 | SPECIAL, /* 0x41 - F7 */ |
144 | SPECIAL, /* 0x42 - F8 */ |
144 | SPECIAL, /* 0x42 - F8 */ |
145 | SPECIAL, /* 0x43 - F9 */ |
145 | SPECIAL, /* 0x43 - F9 */ |
146 | SPECIAL, /* 0x44 - F10 */ |
146 | SPECIAL, /* 0x44 - F10 */ |
147 | SPECIAL, /* 0x45 - NumLock */ |
147 | SPECIAL, /* 0x45 - NumLock */ |
148 | SPECIAL, /* 0x46 - ScrollLock */ |
148 | SPECIAL, /* 0x46 - ScrollLock */ |
149 | '7', '8', '9', '-', |
149 | '7', '8', '9', '-', |
150 | '4', '5', '6', '+', |
150 | '4', '5', '6', '+', |
151 | '1', '2', '3', |
151 | '1', '2', '3', |
152 | '0', '.', |
152 | '0', '.', |
153 | SPECIAL, /* 0x54 - Alt-SysRq */ |
153 | SPECIAL, /* 0x54 - Alt-SysRq */ |
154 | SPECIAL, /* 0x55 - F11/F12/PF1/FN */ |
154 | SPECIAL, /* 0x55 - F11/F12/PF1/FN */ |
155 | SPECIAL, /* 0x56 - unlabelled key next to LAlt */ |
155 | SPECIAL, /* 0x56 - unlabelled key next to LAlt */ |
156 | SPECIAL, /* 0x57 - F11 */ |
156 | SPECIAL, /* 0x57 - F11 */ |
157 | SPECIAL, /* 0x58 - F12 */ |
157 | SPECIAL, /* 0x58 - F12 */ |
158 | SPECIAL, /* 0x59 */ |
158 | SPECIAL, /* 0x59 */ |
159 | SPECIAL, /* 0x5a */ |
159 | SPECIAL, /* 0x5a */ |
160 | SPECIAL, /* 0x5b */ |
160 | SPECIAL, /* 0x5b */ |
161 | SPECIAL, /* 0x5c */ |
161 | SPECIAL, /* 0x5c */ |
162 | SPECIAL, /* 0x5d */ |
162 | SPECIAL, /* 0x5d */ |
163 | SPECIAL, /* 0x5e */ |
163 | SPECIAL, /* 0x5e */ |
164 | SPECIAL, /* 0x5f */ |
164 | SPECIAL, /* 0x5f */ |
165 | SPECIAL, /* 0x60 */ |
165 | SPECIAL, /* 0x60 */ |
166 | SPECIAL, /* 0x61 */ |
166 | SPECIAL, /* 0x61 */ |
167 | SPECIAL, /* 0x62 */ |
167 | SPECIAL, /* 0x62 */ |
168 | SPECIAL, /* 0x63 */ |
168 | SPECIAL, /* 0x63 */ |
169 | SPECIAL, /* 0x64 */ |
169 | SPECIAL, /* 0x64 */ |
170 | SPECIAL, /* 0x65 */ |
170 | SPECIAL, /* 0x65 */ |
171 | SPECIAL, /* 0x66 */ |
171 | SPECIAL, /* 0x66 */ |
172 | SPECIAL, /* 0x67 */ |
172 | SPECIAL, /* 0x67 */ |
173 | SPECIAL, /* 0x68 */ |
173 | SPECIAL, /* 0x68 */ |
174 | SPECIAL, /* 0x69 */ |
174 | SPECIAL, /* 0x69 */ |
175 | SPECIAL, /* 0x6a */ |
175 | SPECIAL, /* 0x6a */ |
176 | SPECIAL, /* 0x6b */ |
176 | SPECIAL, /* 0x6b */ |
177 | SPECIAL, /* 0x6c */ |
177 | SPECIAL, /* 0x6c */ |
178 | SPECIAL, /* 0x6d */ |
178 | SPECIAL, /* 0x6d */ |
179 | SPECIAL, /* 0x6e */ |
179 | SPECIAL, /* 0x6e */ |
180 | SPECIAL, /* 0x6f */ |
180 | SPECIAL, /* 0x6f */ |
181 | SPECIAL, /* 0x70 */ |
181 | SPECIAL, /* 0x70 */ |
182 | SPECIAL, /* 0x71 */ |
182 | SPECIAL, /* 0x71 */ |
183 | SPECIAL, /* 0x72 */ |
183 | SPECIAL, /* 0x72 */ |
184 | SPECIAL, /* 0x73 */ |
184 | SPECIAL, /* 0x73 */ |
185 | SPECIAL, /* 0x74 */ |
185 | SPECIAL, /* 0x74 */ |
186 | SPECIAL, /* 0x75 */ |
186 | SPECIAL, /* 0x75 */ |
187 | SPECIAL, /* 0x76 */ |
187 | SPECIAL, /* 0x76 */ |
188 | SPECIAL, /* 0x77 */ |
188 | SPECIAL, /* 0x77 */ |
189 | SPECIAL, /* 0x78 */ |
189 | SPECIAL, /* 0x78 */ |
190 | SPECIAL, /* 0x79 */ |
190 | SPECIAL, /* 0x79 */ |
191 | SPECIAL, /* 0x7a */ |
191 | SPECIAL, /* 0x7a */ |
192 | SPECIAL, /* 0x7b */ |
192 | SPECIAL, /* 0x7b */ |
193 | SPECIAL, /* 0x7c */ |
193 | SPECIAL, /* 0x7c */ |
194 | SPECIAL, /* 0x7d */ |
194 | SPECIAL, /* 0x7d */ |
195 | SPECIAL, /* 0x7e */ |
195 | SPECIAL, /* 0x7e */ |
196 | SPECIAL, /* 0x7f */ |
196 | SPECIAL, /* 0x7f */ |
197 | }; |
197 | }; |
198 | 198 | ||
199 | /** @} |
199 | /** @} |
200 | */ |
200 | */ |
201 | 201 |