Home | History | Annotate | Line # | Download | only in us
us-kbdmap.c revision 1.2.4.2
      1  1.2.4.2  thomas /*	$NetBSD: us-kbdmap.c,v 1.2.4.2 2001/09/07 23:09:38 thomas Exp $	*/
      2  1.2.4.2  thomas 
      3  1.2.4.2  thomas #include "../../../dev/kbdmap.h"
      4  1.2.4.2  thomas 
      5  1.2.4.2  thomas /* mode shortcuts: */
      6  1.2.4.2  thomas #define	S KBD_MODE_STRING
      7  1.2.4.2  thomas #define C KBD_MODE_CAPS
      8  1.2.4.2  thomas #define K KBD_MODE_KPAD
      9  1.2.4.2  thomas 
     10  1.2.4.2  thomas 
     11  1.2.4.2  thomas /*
     12  1.2.4.2  thomas |	20.June.95
     13  1.2.4.2  thomas |	Abdulkareem asx (at) ccnet.com
     14  1.2.4.2  thomas |
     15  1.2.4.2  thomas |	Changes made for the US keyboard
     16  1.2.4.2  thomas |	The pipe symbol '|', the double-quote '"', the at sign, '@', the
     17  1.2.4.2  thomas |	tidle '~', the backslash '\' were incompatible to the built-in
     18  1.2.4.2  thomas |	keymap and therefore not available on the US keyabords.
     19  1.2.4.2  thomas |
     20  1.2.4.2  thomas |	I've added the loadkmap us-map line in my /etc/rc.local file; don't
     21  1.2.4.2  thomas |	know where else to put it.
     22  1.2.4.2  thomas |
     23  1.2.4.2  thomas */
     24  1.2.4.2  thomas 
     25  1.2.4.2  thomas 
     26  1.2.4.2  thomas struct kbdmap kbdmap;
     27  1.2.4.2  thomas struct kbdmap ascii_kbdmap = {
     28  1.2.4.2  thomas 	/* normal map */
     29  1.2.4.2  thomas 	{
     30  1.2.4.2  thomas /* 0x00 */	0, 0,		0, ESC,		0, '1',		0, '2',
     31  1.2.4.2  thomas /* 0x04 */	0, '3',		0, '4',		0, '5',		0, '6',
     32  1.2.4.2  thomas /* 0x08 */	0, '7',		0, '8',		0, '9',		0, '0',
     33  1.2.4.2  thomas /* 0x0c */	0, '-',		0, '=',		0, '\b',	0, '\t',
     34  1.2.4.2  thomas /* 0x10	*/	C, 'q',		C, 'w',		C, 'e',		C, 'r',
     35  1.2.4.2  thomas /* 0x14 */	C, 't',		C, 'y',		C, 'u',		C, 'i',
     36  1.2.4.2  thomas /* 0x18 */	C, 'o',		C, 'p',		0, '[',		0, ']',
     37  1.2.4.2  thomas /* 0x1c */	0, '\r',	0, DEL,		C, 'a',		C, 's',
     38  1.2.4.2  thomas /* 0x20 */	C, 'd',		C, 'f',		C, 'g',		C, 'h',
     39  1.2.4.2  thomas /* 0x24 */	C, 'j',		C, 'k',		C, 'l',		0, ';',
     40  1.2.4.2  thomas /* 0x28 */	0, '\'',	0, '`',		0, 0,		0, '\\',
     41  1.2.4.2  thomas /* 0x2c */	C, 'z',		C, 'x',		C, 'c',		C, 'v',
     42  1.2.4.2  thomas /* 0x30 */	C, 'b',		C, 'n',		C, 'm',		0, ',',
     43  1.2.4.2  thomas /* 0x34 */	0, '.',		0, '/',		0, 0,		0, 0,
     44  1.2.4.2  thomas /* 0x38 */	0, 0,		0, ' ',		0, 0,		S, 0x10,
     45  1.2.4.2  thomas /* 0x3c */	S, 0x15,	S, 0x1A,	S, 0x1F,	S, 0x24,
     46  1.2.4.2  thomas /* 0x40 */	S, 0x29,	S, 0x2E,	S, 0x33,	S, 0x38,
     47  1.2.4.2  thomas /* 0x44 */	S, 0x3D,	0, 0,		0, 0,		0, 0,
     48  1.2.4.2  thomas /* 0x48 */	S, 0x00,	0, 0,		0, '-',		S, 0x0C,
     49  1.2.4.2  thomas /* 0x4c */	0, 0,		S, 0x08,	0, '+',		0, 0,
     50  1.2.4.2  thomas /* 0x50 */	S, 0x04,	0, 0,		0, 0,		0, DEL,
     51  1.2.4.2  thomas /* 0x54 */	0, 0,		0, 0,		0, 0,		0, 0,
     52  1.2.4.2  thomas /* 0x58 */	0, 0,		0, 0,		0, 0,		0, 0,
     53  1.2.4.2  thomas /* 0x5c */	0, 0,		0, 0,		0, 0,		0, 0,
     54  1.2.4.2  thomas /* 0x60 */
     55  1.2.4.2  thomas /* 0x60 */	0, 0,		0, 0,		0, 0,		0, '(',
     56  1.2.4.2  thomas /* 0x64 */	0, ')',		0, '/',		0, '*',		K, '7',
     57  1.2.4.2  thomas /* 0x68 */	K, '8',		K, '9',		K, '4',		K, '5',
     58  1.2.4.2  thomas /* 0x6c */	K, '6',		K, '1',		K, '2',		K, '3',
     59  1.2.4.2  thomas /* 0x70 */	K, '0',		K, '.',		K, '\r',	0, 0,
     60  1.2.4.2  thomas /* 0x74 */	0, 0,		0, 0,		0, 0,		0, 0,
     61  1.2.4.2  thomas /* 0x78 */	0, 0,		0, 0,		0, 0,		0, 0,
     62  1.2.4.2  thomas /* 0x7c */	0, 0,		0, 0,		0, 0,		0, 0
     63  1.2.4.2  thomas },
     64  1.2.4.2  thomas 	/* shifted map */
     65  1.2.4.2  thomas 	{
     66  1.2.4.2  thomas /* 0x00 */	0, 0,		0, ESC,		0, '!',		0, '@',
     67  1.2.4.2  thomas /* 0x04 */	0, '#',		0, '$',		0, '%',		0, '^',
     68  1.2.4.2  thomas /* 0x08 */	0, '&',		0, '*',		0, '(',		0, ')',
     69  1.2.4.2  thomas /* 0x0c */	0, '_',		0, '+',		0, '\b',	0, '\t',
     70  1.2.4.2  thomas /* 0x10	*/	C, 'Q',		C, 'W',		C, 'E',		C, 'R',
     71  1.2.4.2  thomas /* 0x14 */	C, 'T',		C, 'Y',		C, 'U',		C, 'I',
     72  1.2.4.2  thomas /* 0x18 */	C, 'O',		C, 'P',		0, '{',		0, '}',
     73  1.2.4.2  thomas /* 0x1c */	0, '\r',	0, 0,		C, 'A',		C, 'S',
     74  1.2.4.2  thomas /* 0x20 */	C, 'D',		C, 'F',		C, 'G',		C, 'H',
     75  1.2.4.2  thomas /* 0x24 */	C, 'J',		C, 'K',		C, 'L',		0, ':',
     76  1.2.4.2  thomas /* 0x28 */	0, '"',		0, '~',		0, 0,		0, '|',
     77  1.2.4.2  thomas /* 0x2c */	C, 'Z',		C, 'X',		C, 'C',		C, 'V',
     78  1.2.4.2  thomas /* 0x30 */	C, 'B',		C, 'N',		C, 'M',		0, '<',
     79  1.2.4.2  thomas /* 0x34 */	0, '>',		0, '?',		0, 0,		0, 0,
     80  1.2.4.2  thomas /* 0x38 */	0, 0,		0, ' ',		0, 0,		S, 0x5d,
     81  1.2.4.2  thomas /* 0x3c */	S, 0x63,	S, 0x69,	S, 0x6F,	S, 0x75,
     82  1.2.4.2  thomas /* 0x40 */	S, 0x7b,	S, 0x81,	S, 0x87,	S, 0x8d,
     83  1.2.4.2  thomas /* 0x44 */	S, 0x93,	0, 0,		0, 0,		0, 0,
     84  1.2.4.2  thomas /* 0x48 */	S, 0x47,	0, 0,		0, '-',		S, 0x57,
     85  1.2.4.2  thomas /* 0x4c */	0, 0,		S, 0x51,	0, '+',		0, 0,
     86  1.2.4.2  thomas /* 0x50 */	S, 0x4c,	0, 0,		0, 0,		0, DEL,
     87  1.2.4.2  thomas /* 0x54 */	0, 0,		0, 0,		0, 0,		0, 0,
     88  1.2.4.2  thomas /* 0x58 */	0, 0,		0, 0,		0, 0,		0, 0,
     89  1.2.4.2  thomas /* 0x5c */	0, 0,		0, 0,		0, 0,		0, 0,
     90  1.2.4.2  thomas /* 0x60 */
     91  1.2.4.2  thomas /* 0x60 */	0, 0,		0, 0,		0, 0,		0, '(',
     92  1.2.4.2  thomas /* 0x64 */	0, ')',		0, '/',		0, '*',		K, '7',
     93  1.2.4.2  thomas /* 0x68 */	K, '8',		K, '9',		K, '4',		K, '5',
     94  1.2.4.2  thomas /* 0x6c */	K, '6',		K, '1',		K, '2',		K, '3',
     95  1.2.4.2  thomas /* 0x70 */	K, '0',		K, '.',		K, '\r',	0, 0,
     96  1.2.4.2  thomas /* 0x74 */	0, 0,		0, 0,		0, 0,		0, 0,
     97  1.2.4.2  thomas /* 0x78 */	0, 0,		0, 0,		0, 0,		0, 0,
     98  1.2.4.2  thomas /* 0x7c */	0, 0,		0, 0,		0, 0,		0, 0
     99  1.2.4.2  thomas 	},
    100  1.2.4.2  thomas 
    101  1.2.4.2  thomas 	/* alt map FIXME: No altmap yet.. */
    102  1.2.4.2  thomas 	{
    103  1.2.4.2  thomas 		0, 0
    104  1.2.4.2  thomas 	},
    105  1.2.4.2  thomas 
    106  1.2.4.2  thomas 	/* shift alt map FIXME: No shift altmap yet... */
    107  1.2.4.2  thomas 	{
    108  1.2.4.2  thomas 		0, 0
    109  1.2.4.2  thomas 	},
    110  1.2.4.2  thomas 
    111  1.2.4.2  thomas 	{
    112  1.2.4.2  thomas 	  /* string table. If there's a better way to get the offsets into the
    113  1.2.4.2  thomas 	     above table, please tell me..
    114  1.2.4.2  thomas 
    115  1.2.4.2  thomas 	     NOTE: save yourself and others a lot of grief by *not* using
    116  1.2.4.2  thomas 	           CSI == 0x9b, using the two-character sequence gives
    117  1.2.4.2  thomas 	           much less trouble, especially in GNU-Emacs.. */
    118  1.2.4.2  thomas 
    119  1.2.4.2  thomas 	  3, ESC, '[', 'A',		/* 0x00: CRSR UP */
    120  1.2.4.2  thomas 	  3, ESC, '[', 'B',		/* 0x04: CRSR DOWN */
    121  1.2.4.2  thomas 	  3, ESC, '[', 'C',		/* 0x08: CRSR RIGHT */
    122  1.2.4.2  thomas 	  3, ESC, '[', 'D',		/* 0x0C: CRSR LEFT */
    123  1.2.4.2  thomas 	  4, ESC, '[', '0', '~',	/* 0x10: F1 */
    124  1.2.4.2  thomas 	  4, ESC, '[', '1', '~',	/* 0x15: F2 */
    125  1.2.4.2  thomas 	  4, ESC, '[', '2', '~',	/* 0x1A: F3 */
    126  1.2.4.2  thomas 	  4, ESC, '[', '3', '~',	/* 0x1F: F4 */
    127  1.2.4.2  thomas 	  4, ESC, '[', '4', '~',	/* 0x24: F5 */
    128  1.2.4.2  thomas 	  4, ESC, '[', '5', '~',	/* 0x29: F6 */
    129  1.2.4.2  thomas 	  4, ESC, '[', '6', '~',	/* 0x2E: F7 */
    130  1.2.4.2  thomas 	  4, ESC, '[', '7', '~',	/* 0x33: F8 */
    131  1.2.4.2  thomas 	  4, ESC, '[', '8', '~',	/* 0x38: F9 */
    132  1.2.4.2  thomas 	  4, ESC, '[', '9', '~',	/* 0x3D: F10 */
    133  1.2.4.2  thomas 	  4, ESC, '[', '?', '~',	/* 0x42: HELP */
    134  1.2.4.2  thomas 
    135  1.2.4.2  thomas 	  4, ESC, '[', 'T', '~',	/* 0x47: shift CRSR UP */
    136  1.2.4.2  thomas 	  4, ESC, '[', 'S', '~',	/* 0x4C: shift CRSR DOWN */
    137  1.2.4.2  thomas 	  5, ESC, '[', ' ', '@', '~',	/* 0x51: shift CRSR RIGHT */
    138  1.2.4.2  thomas 	  5, ESC, '[', ' ', 'A', '~',	/* 0x57: shift CRSR LEFT */
    139  1.2.4.2  thomas 	  5, ESC, '[', '1', '0', '~',	/* 0x5D: shift F1 */
    140  1.2.4.2  thomas 	  5, ESC, '[', '1', '1', '~',	/* 0x63: shift F2 */
    141  1.2.4.2  thomas 	  5, ESC, '[', '1', '2', '~',	/* 0x69: shift F3 */
    142  1.2.4.2  thomas 	  5, ESC, '[', '1', '3', '~',	/* 0x6F: shift F4 */
    143  1.2.4.2  thomas 	  5, ESC, '[', '1', '4', '~',	/* 0x75: shift F5 */
    144  1.2.4.2  thomas 	  5, ESC, '[', '1', '5', '~',	/* 0x7B: shift F6 */
    145  1.2.4.2  thomas 	  5, ESC, '[', '1', '6', '~',	/* 0x81: shift F7 */
    146  1.2.4.2  thomas 	  5, ESC, '[', '1', '7', '~',	/* 0x87: shift F8 */
    147  1.2.4.2  thomas 	  5, ESC, '[', '1', '8', '~',	/* 0x8D: shift F9 */
    148  1.2.4.2  thomas 	  5, ESC, '[', '1', '9', '~',	/* 0x93: shift F10 */
    149  1.2.4.2  thomas 	  3, ESC, '[', 'Z',		/* 0x99: shift TAB */
    150  1.2.4.2  thomas 	  2, ESC, '[',			/* 0x9d: alt ESC == CSI */
    151  1.2.4.2  thomas 	},
    152  1.2.4.2  thomas };
    153  1.2.4.2  thomas 
    154  1.2.4.2  thomas #ifndef _KERNEL
    155  1.2.4.2  thomas main()
    156  1.2.4.2  thomas {
    157  1.2.4.2  thomas   exit(write (1, &ascii_kbdmap, sizeof (kbdmap)) == sizeof (kbdmap) ? 0 : 1);
    158  1.2.4.2  thomas }
    159  1.2.4.2  thomas #endif /* _KERNEL */
    160