Home | History | Annotate | Line # | Download | only in dev
kbdmap.h revision 1.10.48.1
      1  1.10.48.1  nathanw /*	$NetBSD: kbdmap.h,v 1.10.48.1 2002/02/28 04:06:51 nathanw Exp $	*/
      2        1.5   chopps 
      3        1.7   chopps /*
      4        1.7   chopps  * Copyright (c) 1993 Markus Wild
      5        1.7   chopps  * All rights reserved.
      6        1.7   chopps  *
      7        1.7   chopps  * Redistribution and use in source and binary forms, with or without
      8        1.7   chopps  * modification, are permitted provided that the following conditions
      9        1.7   chopps  * are met:
     10        1.7   chopps  * 1. Redistributions of source code must retain the above copyright
     11        1.7   chopps  *    notice, this list of conditions and the following disclaimer.
     12        1.7   chopps  * 2. Redistributions in binary form must reproduce the above copyright
     13        1.7   chopps  *    notice, this list of conditions and the following disclaimer in the
     14        1.7   chopps  *    documentation and/or other materials provided with the distribution.
     15        1.7   chopps  * 3. All advertising materials mentioning features or use of this software
     16        1.7   chopps  *    must display the following acknowledgement:
     17        1.7   chopps  *      This product includes software developed by Markus Wild.
     18        1.7   chopps  * 4. The name of the author may not be used to endorse or promote products
     19        1.7   chopps  *    derived from this software without specific prior written permission
     20        1.7   chopps  *
     21        1.7   chopps  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22        1.7   chopps  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23        1.7   chopps  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24        1.7   chopps  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25        1.7   chopps  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26        1.7   chopps  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27        1.7   chopps  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28        1.7   chopps  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29        1.7   chopps  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30        1.7   chopps  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31        1.7   chopps  */
     32        1.1       mw #define NUL	0
     33        1.1       mw #define SOH	1
     34        1.1       mw #define STX	2
     35        1.1       mw #define ETX	3
     36        1.1       mw #define EOT	4
     37        1.1       mw #define ENQ	5
     38        1.1       mw #define ACK	6
     39        1.1       mw #define	BEL	7
     40        1.1       mw #define BS	8
     41        1.1       mw #define HT	9
     42        1.1       mw #define LF	10
     43        1.1       mw #define VT	11
     44        1.1       mw #define FF	12
     45        1.1       mw #define CR	13
     46        1.1       mw #define SO	14
     47        1.1       mw #define SI	15
     48        1.1       mw #define DLE	16
     49        1.1       mw #define DC1	17
     50        1.1       mw #define DC2	18
     51        1.1       mw #define DC3	19
     52        1.1       mw #define DC4	20
     53        1.1       mw #define NAK	21
     54        1.1       mw #define SYN	22
     55        1.1       mw #define ETB	23
     56        1.1       mw #define CAN	24
     57        1.1       mw #define EM	25
     58        1.1       mw #define SUB	26
     59        1.1       mw #define ESC	27
     60        1.1       mw #define FS	28
     61        1.1       mw #define GS	29
     62        1.1       mw #define RS	30
     63        1.1       mw #define US	31
     64        1.1       mw #define	DEL	127
     65        1.1       mw #define IND	132
     66        1.1       mw #define NEL	133
     67        1.1       mw #define SSA	134
     68        1.1       mw #define ESA	135
     69        1.1       mw #define HTS	136
     70        1.1       mw #define HTJ	137
     71        1.1       mw #define VTS	138
     72        1.1       mw #define PLD	139
     73        1.1       mw #define PLU	140
     74        1.1       mw #define RI	141
     75        1.1       mw #define SS2	142
     76        1.1       mw #define SS3	143
     77        1.1       mw #define DCS	144
     78        1.1       mw #define PU1	145
     79        1.1       mw #define PU2	146
     80        1.1       mw #define STS	147
     81        1.1       mw #define CCH	148
     82        1.1       mw #define MW	149
     83        1.1       mw #define SPA	150
     84        1.1       mw #define EPA	151
     85        1.1       mw #define CSI	155
     86        1.1       mw #define ST	156
     87        1.1       mw #define OSC	157
     88        1.1       mw #define PM	158
     89        1.1       mw #define APC	159
     90        1.1       mw 
     91        1.1       mw 
     92        1.1       mw /* a normal Amiga keyboard has 0x60 `normal' keys, plus modifier keys that
     93        1.1       mw    don't appear in the keymap */
     94        1.1       mw #define KBD_NUM_KEYS	0x60
     95        1.1       mw 
     96        1.1       mw /* size of string table */
     97        1.1       mw #define KBD_STRTAB_SIZE	255
     98        1.1       mw 
     99        1.9   chopps /* for dead keys, index into acctable (plus 1!) */
    100        1.9   chopps #define	KBD_ACC_GRAVE	1
    101        1.9   chopps #define KBD_ACC_ACUTE	2
    102        1.9   chopps #define KBD_ACC_CIRC	3
    103        1.9   chopps #define KBD_ACC_TILDE	4
    104        1.9   chopps #define KBD_ACC_DIER	5
    105        1.9   chopps #define KBD_NUM_ACC	6
    106        1.1       mw 
    107        1.1       mw 
    108        1.1       mw struct key {
    109        1.1       mw 	unsigned char	mode;	/* see possible values below */
    110        1.1       mw 	unsigned char	code;
    111        1.1       mw };
    112        1.1       mw 
    113        1.1       mw #define KBD_MODE_STRING	(1<<0)	/* code is index into strings[] */
    114        1.1       mw #define KBD_MODE_DEAD	(1<<1)	/* acc-index in upper nibble, code = plain acc */
    115        1.1       mw #define KBD_MODE_CAPS	(1<<2)	/* key is capsable. Only used in non-shifted maps */
    116        1.1       mw #define KBD_MODE_KPAD	(1<<3)	/* key is on keypad */
    117        1.1       mw #define KBD_MODE_GRAVE	(KBD_ACC_GRAVE << 4)
    118        1.1       mw #define KBD_MODE_ACUTE	(KBD_ACC_ACUTE << 4)
    119        1.1       mw #define KBD_MODE_CIRC	(KBD_ACC_CIRC  << 4)
    120        1.1       mw #define KBD_MODE_TILDE	(KBD_ACC_TILDE << 4)
    121        1.1       mw #define KBD_MODE_DIER	(KBD_ACC_DIER  << 4)
    122        1.9   chopps #define KBD_MODE_ACCENT(m) (((m) >> 4) - 1)	/* get accent from mode */
    123        1.1       mw #define KBD_MODE_ACCMASK  (0xf0)
    124        1.1       mw 
    125        1.1       mw struct kbdmap {
    126        1.1       mw 	struct key 	keys[KBD_NUM_KEYS],
    127        1.1       mw 		   	shift_keys[KBD_NUM_KEYS],
    128        1.1       mw 		   	alt_keys[KBD_NUM_KEYS],
    129        1.1       mw 			alt_shift_keys[KBD_NUM_KEYS];
    130        1.1       mw 	unsigned char	strings[KBD_STRTAB_SIZE];
    131        1.1       mw };
    132        1.1       mw 
    133        1.1       mw 
    134        1.8      jtc #ifdef _KERNEL
    135        1.1       mw /* XXX: ITE interface */
    136        1.3       mw extern struct kbdmap kbdmap, ascii_kbdmap;
    137        1.1       mw extern unsigned char acctable[KBD_NUM_ACC][64];
    138       1.10    veego #include <sys/cdefs.h>
    139  1.10.48.1  nathanw void kbdenable(void);
    140  1.10.48.1  nathanw int kbdgetcn(void);
    141        1.1       mw #endif
    142