Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / x68k / dev / kbdmap.c
blob6bf5522ee7277102aaee067610cfdc5fad1eee1f
1 /* $NetBSD: kbdmap.c,v 1.5.38.1 2007/05/22 17:27:44 matt Exp $ */
3 /* from: arch/amiga/dev/kbdmap.c */
4 /* modified for X680x0 by Masaru Oki and Makoto MINOURA */
6 #include <sys/cdefs.h>
7 __KERNEL_RCSID(0, "$NetBSD: kbdmap.c,v 1.5.38.1 2007/05/22 17:27:44 matt Exp $");
9 #include "kbdmap.h"
11 /* define a default keymap. This can be changed by keyboard ioctl's */
13 /* mode shortcuts: */
14 #define S KBD_MODE_STRING
15 #define DG (KBD_MODE_DEAD | KBD_MODE_GRAVE)
16 #define DA (KBD_MODE_DEAD | KBD_MODE_ACUTE)
17 #define DC (KBD_MODE_DEAD | KBD_MODE_CIRC)
18 #define DT (KBD_MODE_DEAD | KBD_MODE_TILDE)
19 #define DD (KBD_MODE_DEAD | KBD_MODE_DIER)
20 #define C KBD_MODE_CAPS
21 #define K KBD_MODE_KPAD
22 #define D KBD_MODE_DEAD
24 struct kbdmap kbdmap;
25 struct kbdmap ascii_kbdmap = {
26 /* normal map */
28 {0, 0}, /* 0x00 */
29 {0, ESC},
30 {0, '1'},
31 {0, '2'},
32 {0, '3'},
33 {0, '4'},
34 {0, '5'},
35 {0, '6'},
36 {0, '7'}, /* 0x08 */
37 {0, '8'},
38 {0, '9'},
39 {0, '0'},
40 {0, '-'},
41 {0, '^'},
42 {0, '\\'},
43 {0, DEL}, /* really BS, DEL & BS swapped */
44 {0, '\t'}, /* 0x10 */
45 {C, 'q'},
46 {C, 'w'},
47 {C, 'e'},
48 {C, 'r'},
49 {C, 't'},
50 {C, 'y'},
51 {C, 'u'},
52 {C, 'i'}, /* 0x18 */
53 {C, 'o'},
54 {C, 'p'},
55 {0, '@'},
56 {0, '['},
57 {0, '\r'}, /* return */
58 {C, 'a'},
59 {C, 's'},
60 {C, 'd'}, /* 0x20 */
61 {C, 'f'},
62 {C, 'g'},
63 {C, 'h'},
64 {C, 'j'},
65 {C, 'k'},
66 {C, 'l'},
67 {0, ';'},
68 {0, ':'}, /* 0x28 */
69 {0, ']'},
70 {C, 'z'},
71 {C, 'x'},
72 {C, 'c'},
73 {C, 'v'},
74 {C, 'b'},
75 {C, 'n'},
76 {C, 'm'}, /* 0x30 */
77 {0, ','},
78 {0, '.'},
79 {0, '/'},
80 {0, '_'},
81 {0, ' '},
82 {S, 0x4a}, /* HOME */
83 {0, '\b'}, /* really DEL, BS & DEL swapped */
84 {S, 0x43}, /* 0x38 ROLLUP */
85 {S, 0x3e}, /* ROLLDOWN */
86 {S, 0x6a}, /* UNDO */
87 {S, 0x53}, /* CRSR LEFT */
88 {S, 0x5b}, /* CRSR UP */
89 {S, 0x57}, /* CRSR RIGHT */
90 {S, 0x4f}, /* CRSR DOWN */
91 {S, 0x5f}, /* CLR */
92 {K, '/'}, /* 0x40 */
93 {K, '*'},
94 {K, '-'},
95 {K, '7'},
96 {K, '8'},
97 {K, '9'},
98 {K, '+'},
99 {K, '4'},
100 {K, '5'}, /* 0x48 */
101 {K, '6'},
102 {K, '='},
103 {K, '1'},
104 {K, '2'},
105 {K, '3'},
106 {K, '\r'}, /* enter */
107 {K, '0'},
108 {K, ','}, /* 0x50 */
109 {K, '.'},
110 {0, 0},
111 {0, 0},
112 {S, 0x64}, /* HELP */
113 {0, 0},
114 {0, 0},
115 {0, 0},
116 {0, 0}, /* 0x58 */
117 {0, 0},
118 {0, 0},
119 {0, 0},
120 {0, 0},
121 {0, 0},
122 {S,0x39}, /* INS: not used */
123 {0, 0},
124 {0, 0}, /* 0x60 */
125 {0, 0},
126 {0, 0},
127 {S, 0x00}, /* F1 */
128 {S, 0x04}, /* F2 */
129 {S, 0x08}, /* F3 */
130 {S, 0x0c}, /* F4 */
131 {S, 0x10}, /* F5 */
132 {S, 0x16}, /* F6 */
133 {S, 0x1c}, /* F7 */
134 {S, 0x22}, /* 0x68 F8 */
135 {S, 0x28}, /* F9 */
136 {S, 0x2e}, /* F10 */
139 /* shifted map */
141 {0, 0}, /* 0x00 */
142 {0, ESC},
143 {0, '!'},
144 {0, '\"'},
145 {0, '#'},
146 {0, '$'},
147 {0, '%'},
148 {0, '&'},
149 {0, '\''}, /* 0x08 */
150 {0, '('},
151 {0, ')'},
152 {0, 0},
153 {0, '='},
154 {0, '~'},
155 {0, '|'},
156 {0, DEL}, /* really BS, DEL & BS swapped */
157 {0, '\t'}, /* 0x10 shift TAB */
158 {C, 'Q'},
159 {C, 'W'},
160 {C, 'E'},
161 {C, 'R'},
162 {C, 'T'},
163 {C, 'Y'},
164 {C, 'U'},
165 {C, 'I'}, /* 0x18 */
166 {C, 'O'},
167 {C, 'P'},
168 {0, '`'},
169 {0, '{'},
170 {0, '\r'}, /* return */
171 {C, 'A'},
172 {C, 'S'},
173 {C, 'D'}, /* 0x20 */
174 {C, 'F'},
175 {C, 'G'},
176 {C, 'H'},
177 {C, 'J'},
178 {C, 'K'},
179 {C, 'L'},
180 {0, '+'},
181 {0, '*'}, /* 0x28 */
182 {0, '}'},
183 {C, 'Z'},
184 {C, 'X'},
185 {C, 'C'},
186 {C, 'V'},
187 {C, 'B'},
188 {C, 'N'},
189 {C, 'M'}, /* 0x30 */
190 {0, '<'}, /* 0x38 */
191 {0, '>'},
192 {0, '?'},
193 {0, '_'},
194 {0, ' '},
195 {S, 0x4a}, /* HOME */
196 {0, '\b'}, /* really DEL, BS & DEL swapped */
197 {S, 0x43}, /* 0x38 ROLLUP */
198 {S, 0x3e}, /* ROLLDOWN */
199 {S, 0x6a}, /* UNDO */
200 {D, 0}, /* shift CRSR LEFT */
201 {D, 0}, /* shift CRSR UP */
202 {D, 0}, /* shift CRSR RIGHT */
203 {D, 0}, /* shift CRSR DOWN */
204 {D, 0}, /* CLR */
205 {D, '/'}, /* 0x40 */
206 {D, '*'},
207 {D, '-'},
208 {D, '7'},
209 {D, '8'},
210 {D, '9'},
211 {D, '+'},
212 {D, '4'},
213 {D, '5'}, /* 0x48 */
214 {D, '6'},
215 {D, '='},
216 {D, '1'},
217 {D, '2'},
218 {D, '3'},
219 {K, '\r'}, /* enter */
220 {D, '0'},
221 {D, ','}, /* 0x50 */
222 {D, '.'},
223 {0, 0},
224 {0, 0},
225 {S, 0x64}, /* HELP */
226 {0, 0},
227 {0, 0},
228 {0, 0},
229 {0, 0}, /* 0x58 */
230 {0, 0},
231 {0, 0},
232 {0, 0},
233 {0, 0},
234 {0, 0},
235 {S, 0x39}, /* INS: not used */
236 {0, 0},
237 {0, 0}, /* 0x60 */
238 {0, 0},
239 {0, 0},
240 {S, 0x00}, /* shift F1 */
241 {S, 0x04}, /* shift F2 */
242 {S, 0x08}, /* shift F3 */
243 {S, 0x0c}, /* shift F4 */
244 {S, 0x10}, /* shift F5 */
245 {S, 0x16}, /* shift F6 */
246 {S, 0x1c}, /* shift F7 */
247 {S, 0x22}, /* 0x68 shift F8 */
248 {S, 0x28}, /* shift F9 */
249 {S, 0x2e}, /* shift F10 */
253 /* alt map */
257 /* shift alt map */
262 /* string table. If there's a better way to get the offsets into the
263 above table, please tell me..
265 NOTE: save yourself and others a lot of grief by *not* using
266 CSI == 0x9b, using the two-character sequence gives
267 much less trouble, especially in GNU-Emacs.. */
269 3, ESC, 'O', 'P', /* 0x00: F1 (k1) */
270 3, ESC, 'O', 'Q', /* 0x04: F2 (k2) */
271 3, ESC, 'O', 'R', /* 0x08: F3 (k3) */
272 3, ESC, 'O', 'S', /* 0x0c: F4 (k4) */
273 5, ESC, '[', '1', '7', '~', /* 0x10: F5 (k5) */
274 5, ESC, '[', '1', '8', '~', /* 0x16: F6 (k6) */
275 5, ESC, '[', '1', '9', '~', /* 0x1c: F7 (k7) */
276 5, ESC, '[', '2', '0', '~', /* 0x22: F8 (k8) */
277 5, ESC, '[', '2', '1', '~', /* 0x28: F9 (k9) */
278 5, ESC, '[', '2', '9', '~', /* 0x2e: F10 (k;) */
280 4, ESC, '[', '3', '~', /* 0x34: DEL (kD) */
281 4, ESC, '[', '2', '~', /* 0x39: INS (kI) */
282 4, ESC, '[', '6', '~', /* 0x3e: RDN (kN) */
283 4, ESC, '[', '5', '~', /* 0x43: RUP (kP) */
284 1, 8, /* 0x48: BS (kb) */
286 4, ESC, '[', '1', '~', /* 0x4a: HOME (kh) */
287 3, ESC, '[', 'B', /* 0x4f: down (kd) */
288 3, ESC, '[', 'D', /* 0x53: left (kl) */
289 3, ESC, '[', 'C', /* 0x57: right (kr) */
290 3, ESC, '[', 'A', /* 0x5b: up (ku) */
292 4, ESC, '[', '9', '~', /* 0x5f: CLR (kC) */
293 5, ESC, '[', '2', '8', '~', /* 0x64: HELP (kq) */
294 4, ESC, '[', '7', '~', /* 0x6a: UNDO */
298 unsigned char acctable[KBD_NUM_ACC][64] = {