Rev 4055 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4055 | Rev 4296 | ||
---|---|---|---|
Line 24... | Line 24... | ||
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/kbrd/scanc.h> |
37 | #include <genarch/kbrd/scanc.h> |
- | 38 | #include <typedefs.h> |
|
- | 39 | #include <string.h> |
|
38 | 40 | ||
39 | /** Primary meaning of scancodes. */ |
41 | /** Primary meaning of scancodes. */ |
40 | char sc_primary_map[] = { |
42 | wchar_t sc_primary_map[SCANCODES] = { |
41 | SPECIAL, /* 0x00 */ |
43 | U_NULL, /* 0x00 - undefined */ |
42 | SPECIAL, /* 0x01 - Esc */ |
44 | U_ESCAPE, /* 0x01 - Esc */ |
43 | '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', |
45 | '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', |
44 | '\b', /* 0x0e - Backspace */ |
46 | '\b', /* 0x0e - Backspace */ |
- | 47 | '\t', /* 0x0f - Tab */ |
|
45 | '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', |
48 | 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', |
- | 49 | '\n', /* 0x1e - Enter */ |
|
46 | SPECIAL, /* 0x1d - LCtrl */ |
50 | U_SPECIAL, /* 0x1d - Left Ctrl */ |
47 | 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', |
51 | 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', |
48 | '`', |
- | |
49 | SPECIAL, /* 0x2a - LShift */ |
52 | U_SPECIAL, /* 0x2a - Left Shift */ |
50 | '\\', |
- | |
51 | 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', |
53 | '\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', |
52 | SPECIAL, /* 0x36 - RShift */ |
54 | U_SPECIAL, /* 0x36 - Right Shift */ |
53 | '*', |
55 | U_SPECIAL, /* 0x37 - Print Screen */ |
54 | SPECIAL, /* 0x38 - LAlt */ |
56 | U_SPECIAL, /* 0x38 - Left Alt */ |
55 | ' ', |
57 | ' ', |
56 | SPECIAL, /* 0x3a - CapsLock */ |
58 | U_SPECIAL, /* 0x3a - CapsLock */ |
57 | SPECIAL, /* 0x3b - F1 */ |
59 | U_SPECIAL, /* 0x3b - F1 */ |
58 | SPECIAL, /* 0x3c - F2 */ |
60 | U_SPECIAL, /* 0x3c - F2 */ |
59 | SPECIAL, /* 0x3d - F3 */ |
61 | U_SPECIAL, /* 0x3d - F3 */ |
60 | SPECIAL, /* 0x3e - F4 */ |
62 | U_SPECIAL, /* 0x3e - F4 */ |
61 | SPECIAL, /* 0x3f - F5 */ |
63 | U_SPECIAL, /* 0x3f - F5 */ |
62 | SPECIAL, /* 0x40 - F6 */ |
64 | U_SPECIAL, /* 0x40 - F6 */ |
63 | SPECIAL, /* 0x41 - F7 */ |
65 | U_SPECIAL, /* 0x41 - F7 */ |
64 | SPECIAL, /* 0x42 - F8 */ |
66 | U_SPECIAL, /* 0x42 - F8 */ |
65 | SPECIAL, /* 0x43 - F9 */ |
67 | U_SPECIAL, /* 0x43 - F9 */ |
66 | SPECIAL, /* 0x44 - F10 */ |
68 | U_SPECIAL, /* 0x44 - F10 */ |
67 | SPECIAL, /* 0x45 - NumLock */ |
69 | U_SPECIAL, /* 0x45 - NumLock */ |
68 | SPECIAL, /* 0x46 - ScrollLock */ |
70 | U_SPECIAL, /* 0x46 - ScrollLock */ |
69 | '7', '8', '9', '-', |
71 | U_HOME_ARROW, /* 0x47 - Home */ |
- | 72 | U_UP_ARROW, /* 0x48 - Up Arrow */ |
|
70 | '4', '5', '6', '+', |
73 | U_PAGE_UP, /* 0x49 - Page Up */ |
71 | '1', '2', '3', |
74 | '-', |
- | 75 | U_LEFT_ARROW, /* 0x4b - Left Arrow */ |
|
- | 76 | '5', /* 0x4c - Numpad Center */ |
|
- | 77 | U_RIGHT_ARROW, /* 0x4d - Right Arrow */ |
|
72 | '0', '.', |
78 | '+', |
- | 79 | U_END_ARROW, /* 0x4f - End */ |
|
- | 80 | U_DOWN_ARROW, /* 0x50 - Down Arrow */ |
|
- | 81 | U_PAGE_DOWN, /* 0x51 - Page Down */ |
|
- | 82 | '0', /* 0x52 - Numpad Insert */ |
|
- | 83 | U_DELETE, /* 0x53 - Delete */ |
|
73 | SPECIAL, /* 0x54 - Alt-SysRq */ |
84 | U_SPECIAL, /* 0x54 - Alt-SysRq */ |
74 | SPECIAL, /* 0x55 - F11/F12/PF1/FN */ |
85 | U_SPECIAL, /* 0x55 - F11/F12/PF1/FN */ |
75 | SPECIAL, /* 0x56 - unlabelled key next to LAlt */ |
86 | U_SPECIAL, /* 0x56 - unlabelled key next to LAlt */ |
76 | SPECIAL, /* 0x57 - F11 */ |
87 | U_SPECIAL, /* 0x57 - F11 */ |
77 | SPECIAL, /* 0x58 - F12 */ |
88 | U_SPECIAL, /* 0x58 - F12 */ |
78 | SPECIAL, /* 0x59 */ |
89 | U_SPECIAL, /* 0x59 */ |
79 | SPECIAL, /* 0x5a */ |
90 | U_SPECIAL, /* 0x5a */ |
80 | SPECIAL, /* 0x5b */ |
91 | U_SPECIAL, /* 0x5b */ |
81 | SPECIAL, /* 0x5c */ |
92 | U_SPECIAL, /* 0x5c */ |
82 | SPECIAL, /* 0x5d */ |
93 | U_SPECIAL, /* 0x5d */ |
83 | SPECIAL, /* 0x5e */ |
94 | U_SPECIAL, /* 0x5e */ |
84 | SPECIAL, /* 0x5f */ |
95 | U_SPECIAL, /* 0x5f */ |
85 | SPECIAL, /* 0x60 */ |
96 | U_SPECIAL, /* 0x60 */ |
86 | SPECIAL, /* 0x61 */ |
97 | U_SPECIAL, /* 0x61 */ |
87 | SPECIAL, /* 0x62 */ |
98 | U_SPECIAL, /* 0x62 */ |
88 | SPECIAL, /* 0x63 */ |
99 | U_SPECIAL, /* 0x63 */ |
89 | SPECIAL, /* 0x64 */ |
100 | U_SPECIAL, /* 0x64 */ |
90 | SPECIAL, /* 0x65 */ |
101 | U_SPECIAL, /* 0x65 */ |
91 | SPECIAL, /* 0x66 */ |
102 | U_SPECIAL, /* 0x66 */ |
92 | SPECIAL, /* 0x67 */ |
103 | U_SPECIAL, /* 0x67 */ |
93 | SPECIAL, /* 0x68 */ |
104 | U_SPECIAL, /* 0x68 */ |
94 | SPECIAL, /* 0x69 */ |
105 | U_SPECIAL, /* 0x69 */ |
95 | SPECIAL, /* 0x6a */ |
106 | U_SPECIAL, /* 0x6a */ |
96 | SPECIAL, /* 0x6b */ |
107 | U_SPECIAL, /* 0x6b */ |
97 | SPECIAL, /* 0x6c */ |
108 | U_SPECIAL, /* 0x6c */ |
98 | SPECIAL, /* 0x6d */ |
109 | U_SPECIAL, /* 0x6d */ |
99 | SPECIAL, /* 0x6e */ |
110 | U_SPECIAL, /* 0x6e */ |
100 | SPECIAL, /* 0x6f */ |
111 | U_SPECIAL, /* 0x6f */ |
101 | SPECIAL, /* 0x70 */ |
112 | U_SPECIAL, /* 0x70 */ |
102 | SPECIAL, /* 0x71 */ |
113 | U_SPECIAL, /* 0x71 */ |
103 | SPECIAL, /* 0x72 */ |
114 | U_SPECIAL, /* 0x72 */ |
104 | SPECIAL, /* 0x73 */ |
115 | U_SPECIAL, /* 0x73 */ |
105 | SPECIAL, /* 0x74 */ |
116 | U_SPECIAL, /* 0x74 */ |
106 | SPECIAL, /* 0x75 */ |
117 | U_SPECIAL, /* 0x75 */ |
107 | SPECIAL, /* 0x76 */ |
118 | U_SPECIAL, /* 0x76 */ |
108 | SPECIAL, /* 0x77 */ |
119 | U_SPECIAL, /* 0x77 */ |
109 | SPECIAL, /* 0x78 */ |
120 | U_SPECIAL, /* 0x78 */ |
110 | SPECIAL, /* 0x79 */ |
121 | U_SPECIAL, /* 0x79 */ |
111 | SPECIAL, /* 0x7a */ |
122 | U_SPECIAL, /* 0x7a */ |
112 | SPECIAL, /* 0x7b */ |
123 | U_SPECIAL, /* 0x7b */ |
113 | SPECIAL, /* 0x7c */ |
124 | U_SPECIAL, /* 0x7c */ |
114 | SPECIAL, /* 0x7d */ |
125 | U_SPECIAL, /* 0x7d */ |
115 | SPECIAL, /* 0x7e */ |
126 | U_SPECIAL, /* 0x7e */ |
116 | SPECIAL, /* 0x7f */ |
127 | U_SPECIAL /* 0x7f */ |
117 | }; |
128 | }; |
118 | 129 | ||
119 | /** Secondary meaning of scancodes. */ |
130 | /** Secondary meaning of scancodes. */ |
120 | char sc_secondary_map[] = { |
131 | wchar_t sc_secondary_map[SCANCODES] = { |
121 | SPECIAL, /* 0x00 */ |
132 | U_NULL, /* 0x00 - undefined */ |
122 | SPECIAL, /* 0x01 - Esc */ |
133 | U_ESCAPE, /* 0x01 - Esc */ |
123 | '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', |
134 | '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', |
124 | SPECIAL, /* 0x0e - Backspace */ |
135 | '\b', /* 0x0e - Backspace */ |
- | 136 | '\t', /* 0x0f - Tab */ |
|
125 | '\t', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', |
137 | 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', |
- | 138 | '\n', /* 0x1e - Enter */ |
|
126 | SPECIAL, /* 0x1d - LCtrl */ |
139 | U_SPECIAL, /* 0x1d - Left Ctrl */ |
127 | 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', |
140 | 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~', |
128 | '~', |
- | |
129 | SPECIAL, /* 0x2a - LShift */ |
141 | U_SPECIAL, /* 0x2a - Left Shift */ |
130 | '|', |
- | |
131 | 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', |
142 | '|', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', |
132 | SPECIAL, /* 0x36 - RShift */ |
143 | U_SPECIAL, /* 0x36 - Right Shift */ |
133 | '*', |
144 | U_SPECIAL, /* 0x37 - Print Screen */ |
134 | SPECIAL, /* 0x38 - LAlt */ |
145 | U_SPECIAL, /* 0x38 - Left Alt */ |
135 | ' ', |
146 | ' ', |
136 | SPECIAL, /* 0x3a - CapsLock */ |
147 | U_SPECIAL, /* 0x3a - CapsLock */ |
137 | SPECIAL, /* 0x3b - F1 */ |
148 | U_SPECIAL, /* 0x3b - F1 */ |
138 | SPECIAL, /* 0x3c - F2 */ |
149 | U_SPECIAL, /* 0x3c - F2 */ |
139 | SPECIAL, /* 0x3d - F3 */ |
150 | U_SPECIAL, /* 0x3d - F3 */ |
140 | SPECIAL, /* 0x3e - F4 */ |
151 | U_SPECIAL, /* 0x3e - F4 */ |
141 | SPECIAL, /* 0x3f - F5 */ |
152 | U_SPECIAL, /* 0x3f - F5 */ |
142 | SPECIAL, /* 0x40 - F6 */ |
153 | U_SPECIAL, /* 0x40 - F6 */ |
143 | SPECIAL, /* 0x41 - F7 */ |
154 | U_SPECIAL, /* 0x41 - F7 */ |
144 | SPECIAL, /* 0x42 - F8 */ |
155 | U_SPECIAL, /* 0x42 - F8 */ |
145 | SPECIAL, /* 0x43 - F9 */ |
156 | U_SPECIAL, /* 0x43 - F9 */ |
146 | SPECIAL, /* 0x44 - F10 */ |
157 | U_SPECIAL, /* 0x44 - F10 */ |
147 | SPECIAL, /* 0x45 - NumLock */ |
158 | U_SPECIAL, /* 0x45 - NumLock */ |
148 | SPECIAL, /* 0x46 - ScrollLock */ |
159 | U_SPECIAL, /* 0x46 - ScrollLock */ |
- | 160 | ||
149 | '7', '8', '9', '-', |
161 | U_HOME_ARROW, /* 0x47 - Home */ |
- | 162 | U_UP_ARROW, /* 0x48 - Up Arrow */ |
|
150 | '4', '5', '6', '+', |
163 | U_PAGE_UP, /* 0x49 - Page Up */ |
151 | '1', '2', '3', |
164 | '-', |
- | 165 | U_LEFT_ARROW, /* 0x4b - Left Arrow */ |
|
- | 166 | '5', /* 0x4c - Numpad Center */ |
|
- | 167 | U_RIGHT_ARROW, /* 0x4d - Right Arrow */ |
|
152 | '0', '.', |
168 | '+', |
- | 169 | U_END_ARROW, /* 0x4f - End */ |
|
- | 170 | U_DOWN_ARROW, /* 0x50 - Down Arrow */ |
|
- | 171 | U_PAGE_DOWN, /* 0x51 - Page Down */ |
|
- | 172 | '0', /* 0x52 - Numpad Insert */ |
|
- | 173 | U_DELETE, /* 0x53 - Delete */ |
|
153 | SPECIAL, /* 0x54 - Alt-SysRq */ |
174 | U_SPECIAL, /* 0x54 - Alt-SysRq */ |
154 | SPECIAL, /* 0x55 - F11/F12/PF1/FN */ |
175 | U_SPECIAL, /* 0x55 - F11/F12/PF1/FN */ |
155 | SPECIAL, /* 0x56 - unlabelled key next to LAlt */ |
176 | U_SPECIAL, /* 0x56 - unlabelled key next to LAlt */ |
156 | SPECIAL, /* 0x57 - F11 */ |
177 | U_SPECIAL, /* 0x57 - F11 */ |
157 | SPECIAL, /* 0x58 - F12 */ |
178 | U_SPECIAL, /* 0x58 - F12 */ |
158 | SPECIAL, /* 0x59 */ |
179 | U_SPECIAL, /* 0x59 */ |
159 | SPECIAL, /* 0x5a */ |
180 | U_SPECIAL, /* 0x5a */ |
160 | SPECIAL, /* 0x5b */ |
181 | U_SPECIAL, /* 0x5b */ |
161 | SPECIAL, /* 0x5c */ |
182 | U_SPECIAL, /* 0x5c */ |
162 | SPECIAL, /* 0x5d */ |
183 | U_SPECIAL, /* 0x5d */ |
163 | SPECIAL, /* 0x5e */ |
184 | U_SPECIAL, /* 0x5e */ |
164 | SPECIAL, /* 0x5f */ |
185 | U_SPECIAL, /* 0x5f */ |
165 | SPECIAL, /* 0x60 */ |
186 | U_SPECIAL, /* 0x60 */ |
166 | SPECIAL, /* 0x61 */ |
187 | U_SPECIAL, /* 0x61 */ |
167 | SPECIAL, /* 0x62 */ |
188 | U_SPECIAL, /* 0x62 */ |
168 | SPECIAL, /* 0x63 */ |
189 | U_SPECIAL, /* 0x63 */ |
169 | SPECIAL, /* 0x64 */ |
190 | U_SPECIAL, /* 0x64 */ |
170 | SPECIAL, /* 0x65 */ |
191 | U_SPECIAL, /* 0x65 */ |
171 | SPECIAL, /* 0x66 */ |
192 | U_SPECIAL, /* 0x66 */ |
172 | SPECIAL, /* 0x67 */ |
193 | U_SPECIAL, /* 0x67 */ |
173 | SPECIAL, /* 0x68 */ |
194 | U_SPECIAL, /* 0x68 */ |
174 | SPECIAL, /* 0x69 */ |
195 | U_SPECIAL, /* 0x69 */ |
175 | SPECIAL, /* 0x6a */ |
196 | U_SPECIAL, /* 0x6a */ |
176 | SPECIAL, /* 0x6b */ |
197 | U_SPECIAL, /* 0x6b */ |
177 | SPECIAL, /* 0x6c */ |
198 | U_SPECIAL, /* 0x6c */ |
178 | SPECIAL, /* 0x6d */ |
199 | U_SPECIAL, /* 0x6d */ |
179 | SPECIAL, /* 0x6e */ |
200 | U_SPECIAL, /* 0x6e */ |
180 | SPECIAL, /* 0x6f */ |
201 | U_SPECIAL, /* 0x6f */ |
181 | SPECIAL, /* 0x70 */ |
202 | U_SPECIAL, /* 0x70 */ |
182 | SPECIAL, /* 0x71 */ |
203 | U_SPECIAL, /* 0x71 */ |
183 | SPECIAL, /* 0x72 */ |
204 | U_SPECIAL, /* 0x72 */ |
184 | SPECIAL, /* 0x73 */ |
205 | U_SPECIAL, /* 0x73 */ |
185 | SPECIAL, /* 0x74 */ |
206 | U_SPECIAL, /* 0x74 */ |
186 | SPECIAL, /* 0x75 */ |
207 | U_SPECIAL, /* 0x75 */ |
187 | SPECIAL, /* 0x76 */ |
208 | U_SPECIAL, /* 0x76 */ |
188 | SPECIAL, /* 0x77 */ |
209 | U_SPECIAL, /* 0x77 */ |
189 | SPECIAL, /* 0x78 */ |
210 | U_SPECIAL, /* 0x78 */ |
190 | SPECIAL, /* 0x79 */ |
211 | U_SPECIAL, /* 0x79 */ |
191 | SPECIAL, /* 0x7a */ |
212 | U_SPECIAL, /* 0x7a */ |
192 | SPECIAL, /* 0x7b */ |
213 | U_SPECIAL, /* 0x7b */ |
193 | SPECIAL, /* 0x7c */ |
214 | U_SPECIAL, /* 0x7c */ |
194 | SPECIAL, /* 0x7d */ |
215 | U_SPECIAL, /* 0x7d */ |
195 | SPECIAL, /* 0x7e */ |
216 | U_SPECIAL, /* 0x7e */ |
196 | SPECIAL, /* 0x7f */ |
217 | U_SPECIAL /* 0x7f */ |
197 | }; |
218 | }; |
198 | 219 | ||
199 | /** @} |
220 | /** @} |
200 | */ |
221 | */ |