1 /* $NetBSD: wskbdmap_sgi.c,v 1.4 2005/12/11 12:18:52 christos Exp $ */
4 * Copyright (c) 2004 Steve Rumble
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. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
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.
30 #include <sys/cdefs.h>
31 __KERNEL_RCSID(0, "$NetBSD: wskbdmap_sgi.c,v 1.4 2005/12/11 12:18:52 christos Exp $");
33 #include <sys/types.h>
34 #include <dev/wscons/wsksymdef.h>
35 #include <dev/wscons/wsksymvar.h>
37 #define KC(n) KS_KEYCODE(n)
39 static 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
,
48 KC(0x07), KS_1
, KS_exclam
,
53 KC(0x0C), /* no scroll - not impl */
54 KC(0x0D), KS_2
, KS_at
,
55 KC(0x0E), KS_3
, KS_numbersign
,
62 KC(0x15), KS_4
, KS_dollar
,
63 KC(0x16), KS_5
, KS_percent
,
70 KC(0x1D), KS_6
, KS_asciicircum
,
71 KC(0x1E), KS_7
, KS_ampersand
,
78 KC(0x25), KS_8
, KS_asterisk
,
79 KC(0x26), KS_9
, KS_parenleft
,
83 KC(0x2A), KS_semicolon
, KS_colon
,
85 KC(0x2C), KS_comma
, KS_less
,
86 KC(0x2D), KS_0
, KS_parenright
,
87 KC(0x2E), KS_minus
, KS_underscore
,
89 KC(0x30), KS_bracketleft
, KS_braceleft
,
90 KC(0x31), KS_apostrophe
, KS_quotedbl
,
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 */
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 */
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 */
122 KC(0x51), KS_KP_Enter
,
126 KC(0x55), KS_Control_R
,
139 KC(0x62), KS_Print_Screen
,
140 KC(0x63), KS_Hold_Screen
,
147 KC(0x6A), KS_Num_Lock
,
148 KC(0x6B), KS_KP_Divide
,
149 KC(0x6C), KS_KP_Multiply
,
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.
163 #define KBD_MAP(name, base, map) \
164 { name, base, sizeof(map)/sizeof(keysym_t), map }
166 const struct wscons_keydesc wssgi_keydesctab
[] = {
167 KBD_MAP(KB_US
, 0, wssgi_keydesctab_us
)