1 /* $NetBSD: us-kbdmap.c,v 1.4 1996/06/08 15:29:04 is Exp $ */
5 #include "../../../dev/kbdmap.h"
7 /* define a default keymap. This can be changed by keyboard ioctl's
11 #define S KBD_MODE_STRING
12 #define DG (KBD_MODE_DEAD | KBD_MODE_GRAVE)
13 #define DA (KBD_MODE_DEAD | KBD_MODE_ACUTE)
14 #define DC (KBD_MODE_DEAD | KBD_MODE_CIRC)
15 #define DT (KBD_MODE_DEAD | KBD_MODE_TILDE)
16 #define DD (KBD_MODE_DEAD | KBD_MODE_DIER)
17 #define C KBD_MODE_CAPS
18 #define K KBD_MODE_KPAD
20 struct kbdmap kbdmap
= {
88 0, DEL
, /* really BS, DEL & BS swapped */
93 0, '\b', /* really DEL, BS & DEL swapped */
99 S
, 0x00, /* now it gets hairy.. CRSR UP */
100 S
, 0x04, /* CRSR DOWN */
101 S
, 0x08, /* CRSR RIGHT */
102 S
, 0x0C, /* CRSR LEFT */
103 S
, 0x10, /* 0x50 F1 */
110 S
, 0x33, /* 0x58 F8 */
187 0, DEL
, /* really BS, DEL & BS swapped */
188 S
, 0x99, /* shift TAB */
190 0, '\r', /* return */
192 0, '\b', /* really DEL, BS & DEL swapped */
198 S
, 0x47, /* shift CRSR UP */
199 S
, 0x4C, /* shift CRSR DOWN */
200 S
, 0x51, /* shift CRSR RIGHT */
201 S
, 0x57, /* shift CRSR LEFT */
202 S
, 0x5D, /* 0x50 shift F1 */
203 S
, 0x63, /* shift F2 */
204 S
, 0x69, /* shift F3 */
205 S
, 0x6F, /* shift F4 */
206 S
, 0x75, /* shift F5 */
207 S
, 0x7B, /* shift F6 */
208 S
, 0x81, /* shift F7 */
209 S
, 0x87, /* 0x58 shift F8 */
210 S
, 0x8D, /* shift F9 */
211 S
, 0x93, /* shift F10 */
216 S
, 0x42, /* HELP (no special shift code) */
287 0, DEL
, /* really BS, DEL & BS swapped */
290 0, '\r', /* return */
292 0, '\b', /* really DEL, BS & DEL swapped */
298 S
, 0x00, /* now it gets hairy.. CRSR UP */
299 S
, 0x04, /* CRSR DOWN */
300 S
, 0x08, /* CRSR RIGHT */
301 S
, 0x0C, /* CRSR LEFT */
302 S
, 0x10, /* 0x50 F1 */
309 S
, 0x33, /* 0x58 F8 */
386 0, DEL
, /* really BS, DEL & BS swapped */
389 0, '\r', /* return */
391 0, '\b', /* really DEL, BS & DEL swapped */
397 S
, 0x00, /* now it gets hairy.. CRSR UP */
398 S
, 0x04, /* CRSR DOWN */
399 S
, 0x08, /* CRSR RIGHT */
400 S
, 0x0C, /* CRSR LEFT */
401 S
, 0x10, /* 0x50 F1 */
408 S
, 0x33, /* 0x58 F8 */
419 /* string table. If there's a better way to get the offsets into the
420 above table, please tell me..
422 NOTE: save yourself and others a lot of grief by *not* using
423 CSI == 0x9b, using the two-character sequence gives
424 much less trouble, especially in GNU-Emacs.. */
426 3, ESC
, '[', 'A', /* 0x00: CRSR UP */
427 3, ESC
, '[', 'B', /* 0x04: CRSR DOWN */
428 3, ESC
, '[', 'C', /* 0x08: CRSR RIGHT */
429 3, ESC
, '[', 'D', /* 0x0C: CRSR LEFT */
430 4, ESC
, '[', '0', '~', /* 0x10: F1 */
431 4, ESC
, '[', '1', '~', /* 0x15: F2 */
432 4, ESC
, '[', '2', '~', /* 0x1A: F3 */
433 4, ESC
, '[', '3', '~', /* 0x1F: F4 */
434 4, ESC
, '[', '4', '~', /* 0x24: F5 */
435 4, ESC
, '[', '5', '~', /* 0x29: F6 */
436 4, ESC
, '[', '6', '~', /* 0x2E: F7 */
437 4, ESC
, '[', '7', '~', /* 0x33: F8 */
438 4, ESC
, '[', '8', '~', /* 0x38: F9 */
439 4, ESC
, '[', '9', '~', /* 0x3D: F10 */
440 4, ESC
, '[', '?', '~', /* 0x42: HELP */
442 4, ESC
, '[', 'T', '~', /* 0x47: shift CRSR UP */
443 4, ESC
, '[', 'S', '~', /* 0x4C: shift CRSR DOWN */
444 5, ESC
, '[', ' ', '@', '~', /* 0x51: shift CRSR RIGHT */
445 5, ESC
, '[', ' ', 'A', '~', /* 0x57: shift CRSR LEFT */
446 5, ESC
, '[', '1', '0', '~', /* 0x5D: shift F1 */
447 5, ESC
, '[', '1', '1', '~', /* 0x63: shift F2 */
448 5, ESC
, '[', '1', '2', '~', /* 0x69: shift F3 */
449 5, ESC
, '[', '1', '3', '~', /* 0x6F: shift F4 */
450 5, ESC
, '[', '1', '4', '~', /* 0x75: shift F5 */
451 5, ESC
, '[', '1', '5', '~', /* 0x7B: shift F6 */
452 5, ESC
, '[', '1', '6', '~', /* 0x81: shift F7 */
453 5, ESC
, '[', '1', '7', '~', /* 0x87: shift F8 */
454 5, ESC
, '[', '1', '8', '~', /* 0x8D: shift F9 */
455 5, ESC
, '[', '1', '9', '~', /* 0x93: shift F10 */
456 3, ESC
, '[', 'Z', /* 0x99: shift TAB */
457 2, ESC
, '[', /* 0x9d: alt ESC == CSI */
461 unsigned char acctable
[KBD_NUM_ACC
][64] = {
462 { "@ÀBCDÈFGHÌJKLMNÒPQRSTÙVWXYZ[\\]^_"
463 "`àbcdèfghìjklmnòpqrstùvwxyz{|}~\177"}, /* KBD_ACC_GRAVE */
465 { "@ÁBCDÉFGHÍJKLMNÓPQRSTÚVWXYZ[\\]^_"
466 "`ábcdéfghíjklmnópqrstúvwxyz{|}~\177"}, /* KBD_ACC_ACUTE */
468 { "@ÂBCDÊFGHÎJKLMNÔPQRSTÛVWXYZ[\\]^_"
469 "`âbcdêfghîjklmnôpqrstûvwxyz{|}~\177"}, /* KBD_ACC_CIRC */
471 { "@ÃBCDEFGHIJKLMÑÕPQRSTUVWXYZ[\\]^_"
472 "`ãbcdefghijklmñÕpqrstuvwxyz{|}~\177"}, /* KBD_ACC_TILDE */
474 { "@ÄBCDËFGHÏJKLMNÖPQRSTÜVWXYZ[\\]^_"
475 "`äbcdëfghïjklmnöpqrstüvwxyz{|}~\177"}, /* KBD_ACC_DIER */
483 write (1, &kbdmap
, sizeof (kbdmap
));