xref: /netbsd/sys/arch/amiga/dev/kbdmap.h (revision 9382c873)
1*9382c873Saymeric /*	$NetBSD: kbdmap.h,v 1.11 2002/01/26 13:40:58 aymeric Exp $	*/
2276eff6bSchopps 
3e85a3c53Schopps /*
4e85a3c53Schopps  * Copyright (c) 1993 Markus Wild
5e85a3c53Schopps  * All rights reserved.
6e85a3c53Schopps  *
7e85a3c53Schopps  * Redistribution and use in source and binary forms, with or without
8e85a3c53Schopps  * modification, are permitted provided that the following conditions
9e85a3c53Schopps  * are met:
10e85a3c53Schopps  * 1. Redistributions of source code must retain the above copyright
11e85a3c53Schopps  *    notice, this list of conditions and the following disclaimer.
12e85a3c53Schopps  * 2. Redistributions in binary form must reproduce the above copyright
13e85a3c53Schopps  *    notice, this list of conditions and the following disclaimer in the
14e85a3c53Schopps  *    documentation and/or other materials provided with the distribution.
15e85a3c53Schopps  * 3. All advertising materials mentioning features or use of this software
16e85a3c53Schopps  *    must display the following acknowledgement:
17e85a3c53Schopps  *      This product includes software developed by Markus Wild.
18e85a3c53Schopps  * 4. The name of the author may not be used to endorse or promote products
19e85a3c53Schopps  *    derived from this software without specific prior written permission
20e85a3c53Schopps  *
21e85a3c53Schopps  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22e85a3c53Schopps  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23e85a3c53Schopps  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24e85a3c53Schopps  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25e85a3c53Schopps  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26e85a3c53Schopps  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27e85a3c53Schopps  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28e85a3c53Schopps  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29e85a3c53Schopps  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30e85a3c53Schopps  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31e85a3c53Schopps  */
3233e84123Smw #define NUL	0
3333e84123Smw #define SOH	1
3433e84123Smw #define STX	2
3533e84123Smw #define ETX	3
3633e84123Smw #define EOT	4
3733e84123Smw #define ENQ	5
3833e84123Smw #define ACK	6
3933e84123Smw #define	BEL	7
4033e84123Smw #define BS	8
4133e84123Smw #define HT	9
4233e84123Smw #define LF	10
4333e84123Smw #define VT	11
4433e84123Smw #define FF	12
4533e84123Smw #define CR	13
4633e84123Smw #define SO	14
4733e84123Smw #define SI	15
4833e84123Smw #define DLE	16
4933e84123Smw #define DC1	17
5033e84123Smw #define DC2	18
5133e84123Smw #define DC3	19
5233e84123Smw #define DC4	20
5333e84123Smw #define NAK	21
5433e84123Smw #define SYN	22
5533e84123Smw #define ETB	23
5633e84123Smw #define CAN	24
5733e84123Smw #define EM	25
5833e84123Smw #define SUB	26
5933e84123Smw #define ESC	27
6033e84123Smw #define FS	28
6133e84123Smw #define GS	29
6233e84123Smw #define RS	30
6333e84123Smw #define US	31
6433e84123Smw #define	DEL	127
6533e84123Smw #define IND	132
6633e84123Smw #define NEL	133
6733e84123Smw #define SSA	134
6833e84123Smw #define ESA	135
6933e84123Smw #define HTS	136
7033e84123Smw #define HTJ	137
7133e84123Smw #define VTS	138
7233e84123Smw #define PLD	139
7333e84123Smw #define PLU	140
7433e84123Smw #define RI	141
7533e84123Smw #define SS2	142
7633e84123Smw #define SS3	143
7733e84123Smw #define DCS	144
7833e84123Smw #define PU1	145
7933e84123Smw #define PU2	146
8033e84123Smw #define STS	147
8133e84123Smw #define CCH	148
8233e84123Smw #define MW	149
8333e84123Smw #define SPA	150
8433e84123Smw #define EPA	151
8533e84123Smw #define CSI	155
8633e84123Smw #define ST	156
8733e84123Smw #define OSC	157
8833e84123Smw #define PM	158
8933e84123Smw #define APC	159
9033e84123Smw 
9133e84123Smw 
9233e84123Smw /* a normal Amiga keyboard has 0x60 `normal' keys, plus modifier keys that
9333e84123Smw    don't appear in the keymap */
9433e84123Smw #define KBD_NUM_KEYS	0x60
9533e84123Smw 
9633e84123Smw /* size of string table */
9733e84123Smw #define KBD_STRTAB_SIZE	255
9833e84123Smw 
992ca98c3cSchopps /* for dead keys, index into acctable (plus 1!) */
1002ca98c3cSchopps #define	KBD_ACC_GRAVE	1
1012ca98c3cSchopps #define KBD_ACC_ACUTE	2
1022ca98c3cSchopps #define KBD_ACC_CIRC	3
1032ca98c3cSchopps #define KBD_ACC_TILDE	4
1042ca98c3cSchopps #define KBD_ACC_DIER	5
1052ca98c3cSchopps #define KBD_NUM_ACC	6
10633e84123Smw 
10733e84123Smw 
10833e84123Smw struct key {
10933e84123Smw 	unsigned char	mode;	/* see possible values below */
11033e84123Smw 	unsigned char	code;
11133e84123Smw };
11233e84123Smw 
11333e84123Smw #define KBD_MODE_STRING	(1<<0)	/* code is index into strings[] */
11433e84123Smw #define KBD_MODE_DEAD	(1<<1)	/* acc-index in upper nibble, code = plain acc */
11533e84123Smw #define KBD_MODE_CAPS	(1<<2)	/* key is capsable. Only used in non-shifted maps */
11633e84123Smw #define KBD_MODE_KPAD	(1<<3)	/* key is on keypad */
11733e84123Smw #define KBD_MODE_GRAVE	(KBD_ACC_GRAVE << 4)
11833e84123Smw #define KBD_MODE_ACUTE	(KBD_ACC_ACUTE << 4)
11933e84123Smw #define KBD_MODE_CIRC	(KBD_ACC_CIRC  << 4)
12033e84123Smw #define KBD_MODE_TILDE	(KBD_ACC_TILDE << 4)
12133e84123Smw #define KBD_MODE_DIER	(KBD_ACC_DIER  << 4)
1222ca98c3cSchopps #define KBD_MODE_ACCENT(m) (((m) >> 4) - 1)	/* get accent from mode */
12333e84123Smw #define KBD_MODE_ACCMASK  (0xf0)
12433e84123Smw 
12533e84123Smw struct kbdmap {
12633e84123Smw 	struct key 	keys[KBD_NUM_KEYS],
12733e84123Smw 		   	shift_keys[KBD_NUM_KEYS],
12833e84123Smw 		   	alt_keys[KBD_NUM_KEYS],
12933e84123Smw 			alt_shift_keys[KBD_NUM_KEYS];
13033e84123Smw 	unsigned char	strings[KBD_STRTAB_SIZE];
13133e84123Smw };
13233e84123Smw 
13333e84123Smw 
13471ab4ed9Sjtc #ifdef _KERNEL
13533e84123Smw /* XXX: ITE interface */
1363b2546cfSmw extern struct kbdmap kbdmap, ascii_kbdmap;
13733e84123Smw extern unsigned char acctable[KBD_NUM_ACC][64];
138974e9f6eSveego #include <sys/cdefs.h>
139*9382c873Saymeric void kbdenable(void);
140*9382c873Saymeric int kbdgetcn(void);
14133e84123Smw #endif
142