Documented GVF_SAVE_VAR alongside other flags, and removed a query/doubt
[AROS.git] / rom / keymap / defaultkeymap.c
blobedf5f7d51e08a74258bcb87c5d937e9c37b8afb0
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
9 #include <devices/keymap.h>
12 #undef N
13 #undef S
14 #undef A
15 #undef C
16 #undef D
17 #undef V
18 #undef ST
19 #undef NOP
21 #define N KC_NOQUAL
22 #define S KCF_SHIFT
23 #define A KCF_ALT
24 #define C KCF_CONTROL
25 #define D KCF_DEAD
26 #define V KC_VANILLA
27 #define ST KCF_STRING
28 #define NOP KCF_NOP
30 #define EUR 0xA4 /* ISO 8859-15: Euro = 164 = 0xA4) */
32 static CONST UBYTE lokeymaptypes[] =
34 V, /* 00 */
35 S|A, /* 01 */
36 V, /* 02 */
37 S|A, /* 03 */
38 S|A, /* 04 */
39 S|A, /* 05 */
40 V, /* 06 */
41 S|A, /* 07 */
42 S|A, /* 08 */
43 S|A, /* 09 */
44 S|A, /* 0A */
45 V, /* 0B */
46 S, /* 0C */
47 V, /* 0D */
48 NOP, /* 0E */
49 N, /* 0F */
50 V, /* 10 q */
51 V, /* 11 w */
52 D|V, /* 12 e */
53 V, /* 13 r */
54 V, /* 14 t */
55 D|V, /* 15 z */
56 D|V, /* 16 u */
57 D|V, /* 17 i */
58 D|V, /* 18 o */
59 V, /* 19 p */
60 V, /* 1A */
61 V, /* 1B */
62 NOP, /* 1C */
63 N, /* 1D */
64 N, /* 1E */
65 N, /* 1F */
66 D|V, /* 20 a */
67 V, /* 21 s */
68 V, /* 22 d */
69 D|V, /* 23 f */
70 D|V, /* 24 g */
71 D|V, /* 25 h */
72 D|V, /* 26 j */
73 D|V, /* 27 k */
74 V, /* 28 l */
75 S, /* 29 */
76 S, /* 2A */
77 NOP, /* 2B */
78 NOP, /* 2C */
79 N, /* 2D */
80 N, /* 2E */
81 N, /* 2F */
82 S|A, /* 30 */
83 V, /* 31 y */
84 V, /* 32 x */
85 V, /* 33 c */
86 V, /* 34 v */
87 V, /* 35 b */
88 D|V, /* 36 n */
89 V, /* 37 m */
90 S, /* 38 */
91 S, /* 39 */
92 S, /* 3A */
93 NOP, /* 3B */
94 N, /* 3C */
95 N, /* 3D */
96 N, /* 3E */
97 N, /* 3F */
101 static CONST UBYTE hikeymaptypes[] =
103 D|A, /* 40 SPACE */
104 N, /* 41 BACKSPACE */
105 ST|S, /* 42 TAB */
106 N, /* 43 ENTER */
107 C, /* 44 RETURN */
108 A, /* 45 ESCAPE */
109 N, /* 46 DEL */
110 ST|S, /* 47 INSERT ?? */
111 ST|S, /* 48 PAGE UP ?? */
112 ST|S, /* 49 PAGE DOWN ?? */
113 N, /* 4A NUMERIC PAD - */
114 ST|S, /* 4B F11 ?? */
115 ST|S, /* 4C CURSORUP*/
116 ST|S, /* 4D CURSORDOWN */
117 ST|S, /* 4E CURSORRIGHT */
118 ST|S, /* 4F CURSORLEFT */
119 ST|S, /* 50 F1 */
120 ST|S, /* 51 F2 */
121 ST|S, /* 52 F3 */
122 ST|S, /* 53 F4 */
123 ST|S, /* 54 F5 */
124 ST|S, /* 55 F6 */
125 ST|S, /* 56 F7 */
126 ST|S, /* 57 F8 */
127 ST|S, /* 58 F9 */
128 ST|S, /* 59 F10 */
129 S, /* 5A NUMPAD ( */
130 S, /* 5B NUMPAD ) */
131 N, /* 5C NUMPAD / */
132 N, /* 5D NUMPAD * */
133 N, /* 5E NUMPAD + */
134 ST, /* 5F HELP */
135 NOP, /* 60 LEFT SHIFT*/
136 NOP, /* 61 RIGHT SHIFT */
137 NOP, /* 62 CAPS LOCK */
138 NOP, /* 63 CONTROL */
139 NOP, /* 64 LALT */
140 NOP, /* 65 RALT */
141 NOP, /* 66 LCOMMAND */
142 NOP, /* 67 RCOMMAND */
143 NOP, /* 68 LEFT MOUSE BUTTON*/
144 NOP, /* 69 RIGHT MOUSE BUTTON */
145 NOP, /* 6A MIDDLE MOUSE BUTTON */
146 NOP, /* 6B */
147 NOP, /* 6C */
148 NOP, /* 6D */
149 ST|A, /* 6E PAUSE/BREAK ??*/
150 ST|S, /* 6F F12 ?? */
151 ST|C, /* 70 HOME ?? */
152 ST|C, /* 71 END ?? */
153 NOP, /* 72 */
154 NOP, /* 73 */
155 NOP, /* 74 */
156 NOP, /* 75 */
157 NOP, /* 76 */
158 NOP, /* 77 */
159 NOP, /* 78 */
160 NOP, /* 79 */
161 NOP, /* 7A */
162 NOP, /* 7B */
163 NOP, /* 7C */
164 NOP, /* 7D */
165 NOP, /* 7E */
166 NOP /* 7F */
170 #undef N
171 #undef S
172 #undef A
173 #undef C
174 #undef D
175 #undef V
176 #undef ST
177 #undef NOP
179 #undef STRING
180 #undef DEAD
181 #undef BYTES
183 #define STRING(x) (IPTR)x
184 #define DEAD(x) (IPTR)x
186 #define BYTES(b0, b1, b2, b3) \
187 (((UBYTE)b0)<<24) | (((UBYTE)b1)<<16) | (((UBYTE)b2)<<8) | (((UBYTE)b3)<<0)
190 /* dead symbols
192 1= ´
193 2 = `
194 3 = ^
195 4 = ~
196 5 = "
197 6 = °
201 STATIC CONST UBYTE a_descr[] =
203 DPF_MOD, 0x10,
204 DPF_MOD, 0x17,
205 0, 'æ', /* 0xE6 */
206 0, 'Æ', /* 0xC6 */
207 0, 0x01,
208 0, 0x01,
209 0, 0x81,
210 0, 0x81,
212 'a', 'á' /*0xE1*/, 'à' /*0xE0*/, 'â' /*0xE2*/, 'ã' /*0xE3*/, 'ä' /*0xE4*/, 'å' /*0xE5*/,
214 'A', 'Á' /*0xC1*/, 'À' /*0xC0*/, 'Â' /*0xC2*/, 'Ã' /*0xC3*/, 'Ä' /*0xC4*/, 'Å' /*0xC5*/
217 STATIC CONST UBYTE e_descr[] =
219 DPF_MOD, 0x10,
220 DPF_MOD, 0x17,
221 0, '©',
222 0, '©',
223 0, 0x05,
224 0, 0x05,
225 0, 0x85,
226 0, 0x85,
228 'e', 'é' /*0xE9*/, 'è' /*0xE8*/, 'ê' /*0xEA*/, 'e', 'ë' /*0xEB*/, 'e',
230 'E', 'É' /*0xC9*/, 'È' /*0xC8*/, 'Ê' /*0xCA*/, 'E', 'Ë' /*0xCB*/, 'E'
233 STATIC CONST UBYTE u_descr[] =
235 DPF_MOD, 0x10,
236 DPF_MOD, 0x17,
237 0, 'µ', /* 0xB5 */
238 0, 'µ', /* 0xB5 */
239 0, 0x15,
240 0, 0x15,
241 0, 0x95,
242 0, 0x95,
244 'u', 'ú' /*0xFA*/, 'ù' /*0xF9*/, 'û' /*0xFB*/, 'u', 'ü' /*0xFC*/, 'u',
246 'U', 'Ú' /*0xDA*/, 'Ù' /*0xD9*/, 'Û' /*0xDB*/, 'U', 'Ü' /*0xDC*/, 'U'
249 STATIC CONST UBYTE i_descr[] =
251 DPF_MOD, 0x10,
252 DPF_MOD, 0x17,
253 0, '¡', /* 0xA1 */
254 0, '¦', /* 0xA6 */
255 0, 0x09,
256 0, 0x09,
257 0, 0x89,
258 0, 0x89,
260 'i', 'í' /*0xED*/, 'ì' /*0xEC*/, 'î' /*0xEE*/, 'i', 'ï' /*0xEF*/, 'i',
262 'I', 'Í' /*0xCD*/, 'Ì' /*0xCC*/, 'Î' /*0xCE*/, 'I', 'Ï' /*0xCF*/, 'I'
265 STATIC CONST UBYTE o_descr[] =
267 DPF_MOD, 0x10,
268 DPF_MOD, 0x17,
269 0, 'ø', /* 0xF8 */
270 0, 'Ø', /* 0xD8 */
271 0, 0x0F,
272 0, 0x0F,
273 0, 0x8F,
274 0, 0x8F,
276 'o', 'ó' /*0xF3*/, 'ò' /*0xF2*/, 'ô' /*0xF4*/, 'õ' /*0xF5*/, 'ö' /*0xF6*/, 'o',
278 'O', 'Ó' /*0xD3*/, 'Ò' /*0xD2*/, 'Ô' /*0xD4*/, 'Õ' /*0xD5*/, 'Ö' /*0xD6*/, 'O'
281 STATIC CONST UBYTE y_descr[] =
283 DPF_MOD, 0x10,
284 DPF_MOD, 0x17,
285 0, EUR,
286 0, '¥',
287 0, 0x19,
288 0, 0x19,
289 0, 0x99,
290 0, 0x99,
292 'y', 'ý', 'y', 'y', 'y', 'ÿ', 'y',
294 'Y', 'Ý', 'Y', 'Y', 'Y', 'Y', 'Y'
297 STATIC CONST UBYTE n_descr[] =
299 DPF_MOD, 0x10,
300 DPF_MOD, 0x17,
301 0, 0x00,
302 0, '¯',
303 0, 0x0E,
304 0, 0x0E,
305 0, 0x8E,
306 0, 0x8E,
308 'n', 'n', 'n', 'n', 'ñ', 'n', 'n',
310 'N', 'N', 'N', 'N', 'Ñ', 'N', 'N'
313 STATIC CONST UBYTE f_descr[] =
315 0, 'f',
316 0, 'F',
317 DPF_DEAD, 1,
318 DPF_DEAD, 1,
319 0, 0x6,
320 0, 0x6,
321 0, 0x86,
322 0, 0x86,
325 STATIC CONST UBYTE g_descr[] =
327 0, 'g',
328 0, 'G',
329 DPF_DEAD, 2,
330 DPF_DEAD, 2,
331 0, 0x7,
332 0, 0x7,
333 0, 0x87,
334 0, 0x87,
337 STATIC CONST UBYTE h_descr[] =
339 0, 'h',
340 0, 'H',
341 DPF_DEAD, 3,
342 DPF_DEAD, 3,
343 0, 0x8,
344 0, 0x8,
345 0, 0x88,
346 0, 0x88,
349 STATIC CONST UBYTE j_descr[] =
351 0, 'j',
352 0, 'J',
353 DPF_DEAD, 4,
354 DPF_DEAD, 4,
355 0, 0xa,
356 0, 0xa,
357 0, 0x8a,
358 0, 0x8a,
361 STATIC CONST UBYTE k_descr[] =
363 0, 'k',
364 0, 'K',
365 DPF_DEAD, 5,
366 DPF_DEAD, 5,
367 0, 0xb,
368 0, 0xb,
369 0, 0x8b,
370 0, 0x8b,
374 static CONST IPTR lokeymap[] =
376 BYTES('~', '`', '~', '`'), /* 00 Left of 1 Key */
377 BYTES('!', '¹', '!', '1'), /* 01 1 */
378 BYTES('@', '²', '@', '2'), /* 02 2 */
379 BYTES('#', '³', '#', '3'), /* 03 3 */
380 BYTES('$', '¢', '$', '4'), /* 04 4 */
381 BYTES('%', '¼', '%', '5'), /* 05 5 */
382 BYTES('^', '½', '^', '6'), /* 06 6 */
383 BYTES('&', '¾', '&', '7'), /* 07 7 */
384 BYTES('*', '·', '*', '8'), /* 08 8 */
385 BYTES('(', '«', '(', '9'), /* 09 9 */
386 BYTES(')', '»', ')', '0'), /* 0A 0 */
387 BYTES('_', '-', '_', '-'), /* 0B Right of 0 */
388 BYTES('+', '=', '+', '='), /* 0C 2nd right of 0 */
389 BYTES('|', '\\', '|', '\\'), /* 0D 3rd right of 0 */
390 BYTES(0, 0, 0, 0), /* 0E undefined */
391 BYTES('0', '0', '0', '0'), /* 0F NUM 0 */
392 BYTES('Å', 'å', 'Q', 'q'), /* 10 */
393 BYTES('°', '°', 'W', 'w'), /* 11 */
394 DEAD(e_descr), /* 12 */
395 BYTES('®', '®', 'R', 'r'), /* 13 */
396 BYTES('Þ', 'þ', 'T', 't'), /* 14 */
397 DEAD(y_descr), /* 15 */
398 DEAD(u_descr), /* 16 */
399 DEAD(i_descr), /* 17 */
400 DEAD(o_descr), /* 18 */
401 BYTES('¶', '¶', 'P', 'p'), /* 19 */
403 BYTES('{', '[', '{', '['), /* 1A */
404 BYTES('}', ']', '}', ']'), /* 1B */
405 BYTES(0, 0, 0, 0), /* 1C undefined */
406 BYTES('0', '0', '0', '1'), /* 1D NUM 1*/
407 BYTES('0', '0', '0', '2'), /* 1E NUM 2*/
408 BYTES('0', '0', '0', '3'), /* 1F NUM 3*/
410 DEAD(a_descr), /* 20 */
411 BYTES('§', 'ß', 'S', 's'), /* 21 */
412 BYTES('Ð', 'ð', 'D', 'd'), /* 22 */
413 DEAD(f_descr), /* 23 */
414 DEAD(g_descr), /* 24 */
415 DEAD(h_descr), /* 25 */
416 DEAD(j_descr), /* 26 */
417 DEAD(k_descr), /* 27 */
418 BYTES('£', '£', 'L', 'l'), /* 28 */
420 BYTES(':', ';', ':', ';'), /* 29 */
421 BYTES('"', '\'', '"', '\''), /* 2A */
422 BYTES(0, 0, 0, 0), /* 2B undefined */
423 BYTES(0, 0, 0, 0), /* 2C undefined */
424 BYTES('0', '0', '0', '4'), /* 2D NUM 4 */
425 BYTES('0', '0', '0', '5'), /* 2E NUM 5 */
426 BYTES('0', '0', '0', '6'), /* 2F NUM 6 */
427 BYTES('»', '«', '>', '<'), /* 30 */
429 BYTES('¬', '±', 'Z', 'z'), /* 31 */
430 BYTES('÷', '×', 'X', 'x'), /* 32 */
431 BYTES('Ç', 'ç', 'C', 'c'), /* 33 */
432 BYTES('ª', 'ª', 'V', 'v'), /* 34 */
433 BYTES('º', 'º', 'B', 'b'), /* 35 */
434 DEAD(n_descr), /* 36 */
435 BYTES('¿', '¸', 'M', 'm'), /* 37 */
437 BYTES('<', ',', '<', ','), /* 38 */
438 BYTES('>', '.', '>', '.'), /* 39 */
439 BYTES('?', '/', '?', '/'), /* 3A */
440 BYTES(0, 0, 0, 0), /* 3B */
441 BYTES('0', '0', '0', '.'), /* 3C NUM . */
442 BYTES('0', '0', '0', '7'), /* 3D NUM 7 */
443 BYTES('0', '0', '0', '8'), /* 3E NUM 8 */
444 BYTES('0', '0', '0', '9'), /* 3F NUM 9 */
447 /* Strings for the F1 key. In a real AmigaOS keymap, these would have come after
448 ** the HiKeyMap, but we do it this way to avoid prototyping
450 ** String descriptors are byte arrays and work like this:
452 ** sizeofstring,offset_from_start_array_to_start_of_string
453 ** sizeofstring,offset_from_start_array_to_start_of_string
454 ** ..
455 ** ..
456 ** string1
457 ** string2
458 ** ..
459 ** ..
461 ** The number of strings depends on the qualifier flags
462 ** set in the keymap type.
465 CONST UBYTE f1_descr[] =
467 3,4,
468 4,7,
470 0x9B,'0','~',
471 0x9B,'1','0','~'
474 CONST UBYTE f2_descr[] =
476 3,4,
477 4,7,
479 0x9B,'1','~',
480 0x9B,'1','1','~'
483 CONST UBYTE f3_descr[] =
485 3,4,
486 4,7,
488 0x9B,'2','~',
489 0x9B,'1','2','~'
492 CONST UBYTE f4_descr[] =
494 3,4,
495 4,7,
497 0x9B,'3','~',
498 0x9B,'1','3','~'
501 CONST UBYTE f5_descr[] =
503 3,4,
504 4,7,
506 0x9B,'4','~',
507 0x9B,'1','4','~'
510 CONST UBYTE f6_descr[] =
512 3,4,
513 4,7,
515 0x9B,'5','~',
516 0x9B,'1','5','~'
519 CONST UBYTE f7_descr[] =
521 3,4,
522 4,7,
524 0x9B,'6','~',
525 0x9B,'1','6','~'
528 CONST UBYTE f8_descr[] =
530 3,4,
531 4,7,
533 0x9B,'7','~',
534 0x9B,'1','7','~'
537 CONST UBYTE f9_descr[] =
539 3,4,
540 4,7,
542 0x9B,'8','~',
543 0x9B,'1','8','~'
546 CONST UBYTE f10_descr[] =
548 3,4,
549 4,7,
551 0x9B,'9','~',
552 0x9B,'1','9','~'
555 CONST UBYTE f11_descr[] =
557 4,4,
558 4,8,
560 0x9B,'2','0','~',
561 0x9B,'3','0','~'
564 CONST UBYTE f12_descr[] =
566 4,4,
567 4,8,
569 0x9B,'2','1','~',
570 0x9B,'3','1','~'
573 CONST UBYTE insert_descr[] =
575 4,4,
576 4,8,
578 0x9B,'4','0','~',
579 0x9B,'5','0','~'
582 CONST UBYTE pageup_descr[] =
584 4,4,
585 4,8,
587 0x9B,'4','1','~',
588 0x9B,'5','1','~'
591 CONST UBYTE pagedown_descr[] =
593 4,4,
594 4,8,
596 0x9B,'4','2','~',
597 0x9B,'5','2','~'
600 CONST UBYTE pausebreak_descr[] =
602 4,4,
603 4,8,
605 0x9B,'4','3','~',
606 0x9B,'5','3','~'
609 CONST UBYTE home_descr[] =
611 4,4,
612 4,8,
614 0x9B,'4','4','~',
615 0x9B,'5','4','~'
618 CONST UBYTE end_descr[] =
620 4,4,
621 4,8,
623 0x9B,'4','5','~',
624 0x9B,'5','5','~'
627 CONST UBYTE up_descr[] =
629 2,4,
630 2,6,
632 0x9B,'A',
633 0x9B,'T'
636 CONST UBYTE down_descr[] =
638 2,4,
639 2,6,
641 0x9B,'B',
642 0x9B,'S'
645 CONST UBYTE left_descr[] =
647 2,4,
648 3,6,
650 0x9B,'D',
651 0x9B,' ','A'
654 CONST UBYTE right_descr[] =
656 2,4,
657 3,6,
659 0x9B,'C',
660 0x9B,' ','@'
663 CONST UBYTE tab_descr[] =
665 1,4,
666 2,5,
668 0x9,
669 0x9B,'Z'
672 CONST UBYTE help_descr[] =
674 3,2,
676 0x9B,'?','~'
679 STATIC CONST UBYTE space_descr[] =
681 DPF_MOD, 0x4,
682 0, 0XA0,
684 ' ', '´' /*0xB4*/, '`','^','~', '¨' /*0xA8*/, '°' /*0xB0*/
687 static CONST IPTR hikeymap[] =
689 DEAD(space_descr), /* 40 SPACE */
690 BYTES(8, 8, 8, 8), /* 41 BACKSPACE*/
691 STRING(tab_descr), /* 42 TAB */
692 BYTES(13, 13, 13, 13), /* 43 ENTER */
693 BYTES(0, 0, 10, 13), /* 44 RETURN */
694 BYTES(0, 0, 0x9B, 27), /* 45 ESCAPE */
695 BYTES(127, 127, 127, 127), /* 46 DEL */
696 STRING(insert_descr), /* 47 INSERT ?? */
697 STRING(pageup_descr), /* 48 PAGEUP ?? */
698 STRING(pagedown_descr), /* 49 PAGEDOWN ?? */
699 BYTES('-', '-', '-', '-'), /* 4A NUMPAD - */
700 STRING(f11_descr), /* 4B F11 ?? */
701 STRING(up_descr), /* 4C CURSOR UP*/
702 STRING(down_descr), /* 4D CURSOR DOWN*/
703 STRING(right_descr), /* 4E CURSOR RIGHT */
704 STRING(left_descr), /* 4F CURSOR LEFT */
705 STRING(f1_descr), /* 50 F1 */
706 STRING(f2_descr), /* 51 */
707 STRING(f3_descr), /* 52 */
708 STRING(f4_descr), /* 53 */
709 STRING(f5_descr), /* 54 */
710 STRING(f6_descr), /* 55 */
711 STRING(f7_descr), /* 56 */
712 STRING(f8_descr), /* 57 */
713 STRING(f9_descr), /* 58 */
714 STRING(f10_descr), /* 59 */
715 BYTES('[', '(', '[', '('), /* 5A */
716 BYTES(']', ')', ']', ')'), /* 5B */
717 BYTES('/', '/', '/', '/'), /* 5C */
718 BYTES('*', '*', '*', '*'), /* 5D */
719 BYTES('+', '+', '+', '+'), /* 5E */
720 STRING(help_descr), /* 5F HELP */
721 BYTES(0, 0, 0, 0), /* 60 */
722 BYTES(0, 0, 0, 0), /* 61 */
723 BYTES(0, 0, 0, 0), /* 62 */
724 BYTES(0, 0, 0, 0), /* 63 */
725 BYTES(0, 0, 0, 0), /* 64 */
726 BYTES(0, 0, 0, 0), /* 65 */
727 BYTES(0, 0, 0, 0), /* 66 */
728 BYTES(0, 0, 0, 0), /* 67 */
729 BYTES(0, 0, 0, 0), /* 68 */
730 BYTES(0, 0, 0, 0), /* 69 */
731 BYTES(0, 0, 0, 0), /* 6A */
732 BYTES(0, 0, 0, 0), /* 6B */
733 BYTES(0, 0, 0, 0), /* 6C */
734 BYTES(0, 0, 0, 0), /* 6D */
735 STRING(pausebreak_descr), /* 6E PAUSE/BREAK ?? */
736 STRING(f12_descr), /* 6F F12 ?? */
737 STRING(home_descr), /* 70 HOME ?? */
738 STRING(end_descr), /* 71 END ?? */
739 BYTES(0, 0, 0, 0), /* 72 */
740 BYTES(0, 0, 0, 0), /* 73 */
741 BYTES(0, 0, 0, 0), /* 74 */
742 BYTES(0, 0, 0, 0), /* 75 */
743 BYTES(0, 0, 0, 0), /* 76 */
744 BYTES(0, 0, 0, 0), /* 77 */
745 BYTES(0, 0, 0, 0), /* 78 */
746 BYTES(0, 0, 0, 0), /* 79 */
747 BYTES(0, 0, 0, 0), /* 7A */
748 BYTES(0, 0, 0, 0), /* 7B */
749 BYTES(0, 0, 0, 0), /* 7C */
750 BYTES(0, 0, 0, 0), /* 7D */
751 BYTES(0, 0, 0, 0), /* 7E */
752 BYTES(0, 0, 0, 0), /* 7F */
755 #undef SETBITS
757 #define SETBITS(b0, b1, b2, b3, b4, b5, b6, b7) \
758 (b0<<0)|(b1<<1)|(b2<<2)|(b3<<3)|(b4<<4)|(b5<<5)|(b6<<6)|(b7<<7)
760 static CONST UBYTE locapsable[] =
762 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 00 - 07 */
763 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 08 - 0F */
765 SETBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 10 - 17 */
766 SETBITS(1, 1, 0, 0, 0, 0, 0, 0), /* 18 - 1F */
768 SETBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 20 - 27 */
769 SETBITS(1, 0, 0, 0, 0, 0, 0, 0), /* 28 - 2F */
771 SETBITS(0, 1, 1, 1, 1, 1, 1, 1), /* 30 - 37 */
772 SETBITS(0, 0, 0, 0, 0, 0, 0, 0) /* 38 - 3F */
775 static CONST UBYTE hicapsable[] =
777 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 40 - 47 */
778 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 48 - 4F */
780 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 50 - 57 */
781 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 58 - 5F */
783 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 60 - 67 */
784 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 68 - 6F */
786 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 70 - 77 */
787 SETBITS(0, 0, 0, 0, 0, 0, 0, 0) /* 78 - 7F */
790 static CONST UBYTE lorepeatable[] =
792 SETBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 00 - 07 */
793 SETBITS(1, 1, 1, 1, 1, 1, 0, 1), /* 08 - 0F */
795 SETBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 10 - 17 */
796 SETBITS(1, 1, 1, 1, 0, 1, 1, 1), /* 18 - 1F */
798 SETBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 20 - 27 */
799 SETBITS(1, 1, 1, 1, 0, 1, 1, 1), /* 28 - 2F */
801 SETBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 30 - 37 */
802 SETBITS(1, 1, 1, 0, 1, 1, 1, 1) /* 38 - 3F */
805 static CONST UBYTE hirepeatable[] =
807 SETBITS(1, 1, 1, 0, 0, 0, 1, 0), /* 40 - 47 */
808 SETBITS(1, 1, 0, 0, 1, 1, 1, 1), /* 48 - 4F */
810 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 50 - 57 */
811 SETBITS(0, 0, 1, 1, 1, 1, 1, 0), /* 58 - 5F */
813 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 60 - 67 */
814 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 68 - 6F */
816 SETBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 70 - 77 */
817 SETBITS(0, 0, 0, 0, 0, 0, 0, 0) /* 78 - 7F */
820 CONST struct KeyMap def_km =
822 lokeymaptypes,
823 lokeymap,
824 locapsable,
825 lorepeatable,
827 hikeymaptypes,
828 hikeymap,
829 hicapsable,
830 hirepeatable
833 /* index vertically: (keytype & KC_VANILLA)
834 ** index horizontally: KCF_xxx qualifier combination for keypress.
835 ** Which is used to get the index of the byte describing the keypress.
836 ** X means invalid key.
837 ** S means Ctrl-c alike combination (clear bits 5 and 6)
839 #undef X /* undefined */
840 #undef S /* Ctrl-c like combo */
841 #define X (-1)
842 #define S (-2)
844 #if 1
846 /* stegerg: on the Amiga you get a key event if you
847 press for example CONTROL + A, even if
848 the keymaptype for that key has not set
849 KCF_CONTROL. So it looks like if for a
850 certain keypress some qualifiers are set
851 which are not set in the keymap-type then
852 this qualifiers are simply to be ignored
855 const BYTE keymaptype_table[8][8] =
857 {3, 3, 3, 3, 3, 3, 3, 3}, /* KCF_NOQUAL == 0 */
858 {3, 2, 3, 2, 3, 2, 3, 2}, /* KCF_SHIFT == 1 */
859 {3, 3, 2, 2, 3, 3, 2, 2}, /* KCF_ALT == 2 */
860 {3, 2, 1, 0, 3, 2, 1, 0}, /* KCF_SHIFT|KCF_ALT == 3 */
861 {3, 3, 3, 3, 2, 2, 2, 2}, /* KCF_CONTROL == 4 */
862 {3, 2, 3, 2, 1, 0, 1, 0}, /* KCF_SHIFT|KCF_CONTROL == 5 */
863 {3, 3, 2, 2, 1, 1, 0, 0}, /* KCF_ALT|KCF_CONTROL == 6 */
864 {3, 2, 1, 0, S, X, X, X} /* KCF_SHIFT|KCF_ALT|KCF_CONTROL == KC__VANILLA == 7 */
868 #else
870 const BYTE keymaptype_table[8][8] =
872 {3, X, X, X, X, X, X, X}, /* KCF_NOQUAL == 0 */
873 {3, 2, X, X, X, X, X, X}, /* KCF_SHIFT == 1 */
874 {3, X, 2, X, X, X, X, X}, /* KCF_ALT == 2 */
875 {3, 2, 1, 0, X, X, X, X}, /* KCF_SHIFT|KCF_ALT == 3 */
876 {3, X, X, X, 2, X, X, X}, /* KCF_CONTROL == 4 */
877 {3, 2, X, X, 1, 0, X, X}, /* KCF_SHIFT|KCF_CONTROL == 5 */
878 {3, X, 2, X, 1, X, 0, X}, /* KCF_ALT|KCF_CONTROL == 6 */
879 {3, 2, 1, 0, S, X, X, X} /* KCF_SHIFT|KCF_ALT|KCF_CONTROL == KC__VANILLA == 7 */
882 #endif
884 #undef S
886 /* index vertically: (keytype & KC_VANILLA)
887 ** index horizontally: KCF_xxx qualifier combination for keypress.
888 ** Used to get the number of the string descriptor,
889 ** depending on the KCF_SHIFT, KCF_ALT and KCF_CONTROL qualifiers
890 ** of the key pressed
893 #if 1
895 /* stegerg: see comment before keymaptype_table */
897 const BYTE keymapstr_table[8][8] =
899 {0, 0, 0, 0, 0, 0, 0, 0}, /* KCF_NOQUAL == 0 */
900 {0, 1, 0, 1, 0, 1, 0, 1}, /* KCF_SHIFT == 1 */
901 {0, 0, 1, 1, 0, 0, 1, 1}, /* KCF_ALT == 2 */
902 {0, 1, 2, 3, 0, 1, 2, 3}, /* KCF_SHIFT|KCF_ALT == 3 */
903 {0, 0, 0, 0, 1, 1, 1, 1}, /* KCF_CONTROL == 4 */
904 {0, 1, 0, 1, 2, 3, 2, 3}, /* KCF_SHIFT|KCF_CONTROL == 5 */
905 {0, 0, 1, 1, 2, 2, 3, 3}, /* KCF_ALT|KCF_CONTROL == 6 */
906 {0, 1, 2, 3, 4, 5, 6, 7} /* KCF_SHIFT|KCF_ALT|KCF_CONTROL == KC__VANILLA == 7 */
909 #else
910 const BYTE keymapstr_table[8][8] =
912 {0, X, X, X, X, X, X, X}, /* KCF_NOQUAL == 0 */
913 {0, 1, X, X, X, X, X, X}, /* KCF_SHIFT == 1 */
914 {0, X, 1, X, X, X, X, X}, /* KCF_ALT == 2 */
915 {0, 1, 2, 3, X, X, X, X}, /* KCF_SHIFT|KCF_ALT == 3 */
916 {0, X, X, X, 1, X, X, X}, /* KCF_CONTROL == 4 */
917 {0, 1, X, X, 2, 3, X, X}, /* KCF_SHIFT|KCF_CONTROL == 5 */
918 {0, X, 1, X, 2, X, 3, X}, /* KCF_ALT|KCF_CONTROL == 6 */
919 {0, 1, 2, 3, 4, 5, 6, 7} /* KCF_SHIFT|KCF_ALT|KCF_CONTROL == KC__VANILLA == 7 */
922 #endif
925 #undef X