1/*	$NetBSD: wskbdmap_sgi.c,v 1.4 2005/12/11 12:18:52 christos Exp $	*/
2
3/*
4 * Copyright (c) 2004 Steve Rumble
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
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. The name of the author may not be used to endorse or promote products
16 *    derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__KERNEL_RCSID(0, "$NetBSD: wskbdmap_sgi.c,v 1.4 2005/12/11 12:18:52 christos Exp $");
32
33#include <sys/types.h>
34#include <dev/wscons/wsksymdef.h>
35#include <dev/wscons/wsksymvar.h>
36
37#define KC(n) KS_KEYCODE(n)
38
39static const keysym_t wssgi_keydesctab_us[] = {
40/*	pos		command			normal		shifted */
41	KC(0x00),				/* break - not impl */
42	KC(0x01),				/* setupkey - not impl */
43	KC(0x02),				KS_Control_L,
44	KC(0x03),				KS_Caps_Lock,
45	KC(0x04),				KS_Shift_R,
46	KC(0x05),				KS_Shift_L,
47	KC(0x06),				KS_Escape,
48	KC(0x07),				KS_1,		KS_exclam,
49	KC(0x08),				KS_Tab,
50	KC(0x09),				KS_q,
51	KC(0x0A),				KS_a,
52	KC(0x0B),				KS_s,
53	KC(0x0C),				/* no scroll - not impl */
54	KC(0x0D),				KS_2,		KS_at,
55	KC(0x0E),				KS_3,		KS_numbersign,
56	KC(0x0F),				KS_w,
57	KC(0x10),				KS_e,
58	KC(0x11),				KS_d,
59	KC(0x12),				KS_f,
60	KC(0x13),				KS_z,
61	KC(0x14),				KS_x,
62	KC(0x15),				KS_4,		KS_dollar,
63	KC(0x16),				KS_5,		KS_percent,
64	KC(0x17),				KS_r,
65	KC(0x18),				KS_t,
66	KC(0x19),				KS_g,
67	KC(0x1A),				KS_h,
68	KC(0x1B),				KS_c,
69	KC(0x1C),				KS_v,
70	KC(0x1D),				KS_6,		KS_asciicircum,
71	KC(0x1E),				KS_7,		KS_ampersand,
72	KC(0x1F),				KS_y,
73	KC(0x20),				KS_u,
74	KC(0x21),				KS_j,
75	KC(0x22),				KS_k,
76	KC(0x23),				KS_b,
77	KC(0x24),				KS_n,
78	KC(0x25),				KS_8,		KS_asterisk,
79	KC(0x26),				KS_9,		KS_parenleft,
80	KC(0x27),				KS_i,
81	KC(0x28),				KS_o,
82	KC(0x29),				KS_l,
83	KC(0x2A),				KS_semicolon,	KS_colon,
84	KC(0x2B),				KS_m,
85	KC(0x2C),				KS_comma,	KS_less,
86	KC(0x2D),				KS_0,		KS_parenright,
87	KC(0x2E),				KS_minus,	KS_underscore,
88	KC(0x2F),				KS_p,
89	KC(0x30),				KS_bracketleft,	KS_braceleft,
90	KC(0x31),				KS_apostrophe,	KS_quotedbl,
91	KC(0x32),				KS_Return,
92	KC(0x33),				KS_period,	KS_greater,
93	KC(0x34),				KS_slash,	KS_question,
94	KC(0x35),				KS_equal,	KS_plus,
95	KC(0x36),				KS_grave,	KS_asciitilde,
96	KC(0x37),				KS_bracketright,KS_braceright,
97	KC(0x38),				KS_backslash,	KS_bar,
98	KC(0x39),				KS_KP_End,	KS_KP_1,
99	KC(0x3A),				KS_KP_Insert,	KS_KP_0,
100	KC(0x3B),				KS_Linefeed, 	/* not impl */
101	KC(0x3C),				KS_Delete,
102	KC(0x3D),				KS_Delete,
103	KC(0x3E),				KS_KP_Left,	KS_KP_4,
104	KC(0x3F),				KS_KP_Down,	KS_KP_2,
105	KC(0x40),				KS_KP_Next,	KS_KP_3,
106	KC(0x41),				KS_KP_Delete,	KS_KP_Decimal,
107	KC(0x42),				KS_KP_Home,	KS_KP_7,
108	KC(0x43),				KS_KP_Up,	KS_KP_8,
109	KC(0x44),				KS_KP_Begin,	KS_KP_5,
110	KC(0x45),				KS_KP_Right,	KS_KP_6,
111	KC(0x46),				/* padpf2key - not impl	*/
112	KC(0x47),				/* padpf1key - not impl */
113	KC(0x48),				KS_Left,
114	KC(0x49),				KS_Down,
115	KC(0x4A),				KS_KP_Prior,	KS_KP_9,
116	KC(0x4B),				KS_KP_Subtract,
117	KC(0x4C),				/* padcommakey -- not impl */
118	KC(0x4D),				/* padpf4key -- not impl */
119	KC(0x4E),				/* padpf3key -- not impl */
120	KC(0x4F),				KS_Right,
121	KC(0x50),				KS_Up,
122	KC(0x51),				KS_KP_Enter,
123	KC(0x52),				KS_space,
124	KC(0x53),				KS_Alt_L,
125	KC(0x54),				KS_Alt_R,
126	KC(0x55),				KS_Control_R,
127	KC(0x56),				KS_f1,
128	KC(0x57),				KS_f2,
129	KC(0x58),				KS_f3,
130	KC(0x59),				KS_f4,
131	KC(0x5A),				KS_f5,
132	KC(0x5B),				KS_f6,
133	KC(0x5C),				KS_f7,
134	KC(0x5D),				KS_f8,
135	KC(0x5E),				KS_f9,
136	KC(0x5F),				KS_f10,
137	KC(0x60),				KS_f11,
138	KC(0x61),				KS_f12,
139	KC(0x62),				KS_Print_Screen,
140	KC(0x63),				KS_Hold_Screen,
141	KC(0x64),				KS_Pause,
142	KC(0x65),				KS_Insert,
143	KC(0x66),				KS_Home,
144	KC(0x67),				KS_Prior,
145	KC(0x68),				KS_End,
146	KC(0x69),				KS_Next,
147	KC(0x6A),				KS_Num_Lock,
148	KC(0x6B),				KS_KP_Divide,
149	KC(0x6C),				KS_KP_Multiply,
150	KC(0x6D),				KS_KP_Add,
151
152	/*
153	 * XXXrumble:	On occasion when multiple keys are mashed,
154	 *		the keyboard likes to send undefined or
155	 *		unimplemented sequences. We'll list them
156	 *		here to avoid gratuitous quantities of
157	 *		wskbd_translate errors.
158	 */
159	KC(0x70),
160	KC(0x7F)
161};
162
163#define KBD_MAP(name, base, map) \
164			{ name, base, sizeof(map)/sizeof(keysym_t), map }
165
166const struct wscons_keydesc wssgi_keydesctab[] = {
167	KBD_MAP(KB_US,	0,	wssgi_keydesctab_us)
168};
169