xref: /netbsd/sys/arch/macppc/dev/akbdmap.h (revision bf9ec67e)
1 /*	$NetBSD: akbdmap.h,v 1.4 2002/03/04 04:03:36 dbj Exp $	*/
2 
3 /*-
4  * Copyright (c) 1997 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to The NetBSD Foundation
8  * by Juergen Hannken-Illjes.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. All advertising materials mentioning features or use of this software
19  *    must display the following acknowledgement:
20  *	This product includes software developed by the NetBSD
21  *	Foundation, Inc. and its contributors.
22  * 4. Neither the name of The NetBSD Foundation nor the names of its
23  *    contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  * POSSIBILITY OF SUCH DAMAGE.
37  */
38 
39 /* XXX This list is incomplete. */
40 
41 #define KC(n) KS_KEYCODE(n)
42 
43 static const keysym_t akbd_keydesc_us[] = {
44 /*  pos      command		normal		shifted */
45     KC(0),			KS_a,
46     KC(1),			KS_s,
47     KC(2),			KS_d,
48     KC(3),			KS_f,
49     KC(4),			KS_h,
50     KC(5),			KS_g,
51     KC(6),			KS_z,
52     KC(7),			KS_x,
53     KC(8),			KS_c,
54     KC(9),			KS_v,
55 
56     KC(11),			KS_b,
57     KC(12),			KS_q,
58     KC(13),			KS_w,
59     KC(14),			KS_e,
60     KC(15),			KS_r,
61     KC(16),			KS_y,
62     KC(17),			KS_t,
63     KC(18),			KS_1,		KS_exclam,
64     KC(19),			KS_2,		KS_at,
65     KC(20),			KS_3,		KS_numbersign,
66     KC(21),			KS_4,		KS_dollar,
67     KC(22),			KS_6,		KS_asciicircum,
68     KC(23),			KS_5,		KS_percent,
69     KC(24),			KS_equal,	KS_plus,
70     KC(25),			KS_9,		KS_parenleft,
71     KC(26),			KS_7,		KS_ampersand,
72     KC(27),			KS_minus,	KS_underscore,
73     KC(28),			KS_8,		KS_asterisk,
74     KC(29),			KS_0,		KS_parenright,
75     KC(30),			KS_bracketright, KS_braceright,
76     KC(31),			KS_o,
77     KC(32),			KS_u,
78     KC(33),			KS_bracketleft,	KS_braceleft,
79     KC(34),			KS_i,
80     KC(35),			KS_p,
81     KC(36),			KS_Return,
82     KC(37),			KS_l,
83     KC(38),			KS_j,
84     KC(39),			KS_apostrophe,	KS_quotedbl,
85     KC(40),			KS_k,
86     KC(41),			KS_semicolon,	KS_colon,
87     KC(42),			KS_backslash,	KS_bar,
88     KC(43),			KS_comma,	KS_less,
89     KC(44),			KS_slash,	KS_question,
90     KC(45),			KS_n,
91     KC(46),			KS_m,
92     KC(47),			KS_period,	KS_greater,
93     KC(48),			KS_Tab,
94     KC(49),			KS_space,
95     KC(50),			KS_grave,	KS_asciitilde,
96     KC(51),			KS_Delete,
97     KC(52),			KS_KP_Enter,    /* Maybe we should pretend this is alt-R */
98     KC(53),			KS_Escape,
99     KC(54),			KS_Control_L,
100     KC(55),  KS_Cmd,				/* Command */
101     KC(56),			KS_Shift_L,
102     KC(57),			KS_Caps_Lock,
103     KC(58),  KS_Cmd1,				/* Option */
104     KC(59),			KS_Left,
105     KC(60),			KS_Right,
106     KC(61),			KS_Down,
107     KC(62),			KS_Up,
108 
109     KC(65),			KS_KP_Decimal,
110     KC(67),			KS_KP_Multiply,
111     KC(69),			KS_KP_Add,
112     KC(71),			KS_Clear,
113     KC(75),			KS_KP_Divide,
114     KC(76),			KS_KP_Enter,
115     KC(78),			KS_KP_Subtract,
116 
117     KC(81),			KS_KP_Equal,
118     KC(82),			KS_KP_0,
119     KC(83),			KS_KP_1,
120     KC(84),			KS_KP_2,
121     KC(85),			KS_KP_3,
122     KC(86),			KS_KP_4,
123     KC(87),			KS_KP_5,
124     KC(88),			KS_KP_6,
125     KC(89),			KS_KP_7,
126 
127     KC(91),			KS_KP_8,
128     KC(92),			KS_KP_9,
129 
130     KC(95),			KS_comma,	/* XXX KS_KP_comma */
131     KC(96),			KS_f5,
132     KC(97),			KS_f6,
133     KC(98),			KS_f7,
134     KC(99),			KS_f3,
135     KC(100),			KS_f8,
136 
137     KC(101),			KS_f9,
138 
139     KC(103),			KS_f11,
140 
141     KC(106),			KS_KP_Enter,
142 
143     KC(109),			KS_f10,
144 
145     KC(111),			KS_f12,
146 
147     KC(115),			KS_Home,
148     KC(116),			KS_Prior,
149 
150     KC(118),			KS_f4,
151     KC(119),			KS_End,
152     KC(120),			KS_f2,
153     KC(121),			KS_Next,
154     KC(122),			KS_f1,
155 
156     KC(127),  KS_Cmd_Debugger,
157 };
158 
159 static const keysym_t akbd_keydesc_fr[] = {
160 /*  pos		normal		shifted		altgr		shift-altgr */
161     KC(0),	KS_q,
162     KC(6),	KS_w,
163     KC(10),	KS_at,		KS_numbersign,
164     KC(12),	KS_a,
165     KC(13),	KS_z,
166     KC(18),	KS_ampersand,	KS_1,
167     KC(19),	KS_eacute,	KS_2,		KS_asciitilde,
168     KC(20),	KS_quotedbl,	KS_3,		KS_numbersign,
169     KC(21),	KS_apostrophe,	KS_4,		KS_braceleft,
170     KC(22),	KS_section,	KS_6,		KS_bar,
171     KC(23),	KS_parenleft,	KS_5,		KS_bracketleft,	KS_braceleft,
172     KC(24),	KS_minus,	KS_underscore,	KS_braceright,
173     KC(25),	KS_ccedilla,	KS_9,		KS_asciicircum,
174     KC(26),	KS_egrave,	KS_7,		KS_grave,
175     KC(27),	KS_parenright,	KS_degree,	KS_bracketright, KS_braceright,
176     KC(28),	KS_exclam,	KS_8,		KS_bar,
177     KC(29),	KS_agrave,	KS_0,		KS_at,
178     KC(30),	KS_dollar,	KS_asterisk,
179     KC(33),	KS_dead_circumflex, KS_dead_diaeresis,
180     KC(39),	KS_mu,		KS_percent,
181     KC(40),	KS_k,
182     KC(41),	KS_m,
183     KC(42),	KS_grave,	KS_sterling,
184     KC(43),	KS_semicolon,	KS_period,
185     KC(44),	KS_equal,	KS_plus,
186     KC(46),	KS_comma,	KS_question,
187     KC(47),	KS_colon,	KS_slash,	KS_backslash,
188     KC(50),	KS_less,	KS_greater,
189     KC(52),	KS_Alt_R,
190     KC(55),	KS_Meta_L,				/* Command */
191     KC(58),	KS_Alt_R,				/* Option */
192 };
193 
194 #if 0
195 static const keysym_t akbd_keydesc_jp[] = {
196 /*  pos      command		normal		shifted */
197     KC(42),			KS_grave,	KS_asciitilde,
198     KC(93),			KS_backslash,	KS_bar,
199 };
200 #endif
201 
202 #define KBD_MAP(name, base, map) \
203 			{ name, base, sizeof(map)/sizeof(keysym_t), map }
204 
205 static const struct wscons_keydesc akbd_keydesctab[] = {
206 	KBD_MAP(KB_US,			0,	akbd_keydesc_us),
207 	KBD_MAP(KB_FR,			KB_US,	akbd_keydesc_fr),
208 	{0, 0, 0, 0}
209 };
210 
211 #undef KBD_MAP
212 #undef KC
213