1 /* $NetBSD: kbdmap.h,v 1.4.62.3 2004/09/21 13:13:59 skrll Exp $ */
4 * Copyright (c) 1993 Markus Wild
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Markus Wild.
18 * 4. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #ifndef _MACHINE_KBDMAP_H_
34 #define _MACHINE_KBDMAP_H_
97 * A total of 0x80 scancode are defined for the atari keyboard.
99 #define KBD_NUM_KEYS 0x80
101 /* size of string table */
102 #define KBD_STRTAB_SIZE 255
104 /* for dead keys, index into acctable */
105 /* FIXME: What the hell are dead keys?? */
106 #define KBD_ACC_GRAVE 0
107 #define KBD_ACC_ACUTE 1
108 #define KBD_ACC_CIRC 2
109 #define KBD_ACC_TILDE 3
110 #define KBD_ACC_DIER 4
111 #define KBD_NUM_ACC 5
115 unsigned char mode
; /* see possible values below */
119 #define KBD_MODE_STRING (0x01) /* code is index into strings[] */
120 #define KBD_MODE_DEAD (0x02) /* acc-index in upper nibble, code = plain acc */
121 #define KBD_MODE_CAPS (0x04) /* key is capsable. Only in non-shifted maps */
122 #define KBD_MODE_KPAD (0x08) /* key is on keypad */
123 #define KBD_MODE_GRAVE (KBD_ACC_GRAVE << 4)
124 #define KBD_MODE_ACUTE (KBD_ACC_ACUTE << 4)
125 #define KBD_MODE_CIRC (KBD_ACC_CIRC << 4)
126 #define KBD_MODE_TILDE (KBD_ACC_TILDE << 4)
127 #define KBD_MODE_DIER (KBD_ACC_DIER << 4)
128 #define KBD_MODE_ACCENT(m) ((m) >> 4) /* get accent from mode */
129 #define KBD_MODE_ACCMASK (0xf0)
131 #define KBD_SCANCODE(code) (code & 0x7f)
132 #define KBD_RELEASED(code) (code & 0x80 ? 1 : 0)
133 #define KBD_IS_KEY(code) ((u_char)(code) < 0xf6)
136 struct key keys
[KBD_NUM_KEYS
],
137 shift_keys
[KBD_NUM_KEYS
],
138 alt_keys
[KBD_NUM_KEYS
],
139 alt_shift_keys
[KBD_NUM_KEYS
];
140 unsigned char strings
[KBD_STRTAB_SIZE
];
145 /* XXX: ITE interface */
146 extern struct kbdmap ascii_kbdmap
;
147 extern unsigned char acctable
[KBD_NUM_ACC
][64];
150 #endif /* _MACHINE_KBDMAP_H_ */