xref: /netbsd/share/man/man4/man4.sun2/kbd.4 (revision bf9ec67e)
1.\"	$NetBSD: kbd.4,v 1.2 2002/01/15 02:00:58 wiz Exp $
2.\"
3.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Paul Kranenburg.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"        This product includes software developed by the NetBSD
20.\"        Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\"    contributors may be used to endorse or promote products derived
23.\"    from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd June 22, 1996
38.Dt KBD 4 sun2
39.Os
40.Sh NAME
41.Nm kbd
42.Nd Sun workstation keyboard
43.Sh SYNOPSIS
44.Cd "kbd0 at zstty?"
45.Sh DESCRIPTION
46The
47.Nm
48driver provides an interface to the workstation console keyboard.
49.Qq type 2 ,
50.Qq type 3 ,
51.Qq type 4 ,
52and
53.Qq type 5
54keyboards are supported.
55The
56.Qq type 5
57keyboard is treated as if it were a
58.Qq type 4 .
59All types generate keycodes encoding the
60key identity and motion (up or down) as the keys are pressed and released.
61The
62.Nm
63driver either passes the keycodes to an application as they come in, or
64translates them into
65.Tn ASCII
66characters first according to a set of built-in tables.
67.Pp
68If the keyboard is configured as the device
69to be used for system console input,
70it will be internally connected to the
71.Pa /dev/console
72device special file, which can be used as a
73.Xr tty 4
74device.
75.Pp
76The device special file
77.Pa /dev/kbd
78is used to get direct access to the keyboard input stream.
79The following
80ioctl's are supported (mostly just enough to keep the
81.Xr X 1
82server going):
83.Bl -tag -width KIOCSDIRECT
84.It KIOCTRANS
85Set translation mode.
86The argument is of type
87.Fa "int *" ,
88the only value supported is
89.Dv TR_UNTRANS_EVENT .
90.It KIOCGTRANS
91Get translation mode.
92The argument is of type
93.Fa "int *" .
94.Dv TR_UNTRANS_EVENT
95is always returned.
96.It KIOCGETKEY
97Fill in old-style key station translation.
98The argument is of type
99.Fa "struct okiockey *" .
100.It KIOCCMD
101Send a command to the keyboard.
102The argument is of type
103.Fa "int *" ,
104and can have one of the following values:
105.Bl -tag -width KBD_CMD_NOCLICK
106.It KBD_CMD_BELL
107Start the keyboard beeper.
108.It KBD_CMD_NOBELL
109Stop the keyboard beeper.
110.It KBD_CMD_CLICK
111Instruct the keyboard to make extra noise when touching keys.
112.It KBD_CMD_NOCLICK
113Instruct the keyboard to stop making extra noise when touching keys.
114.El
115.It KIOCTYPE
116Get keyboard type.
117The argument is of type
118.Fa "int *" ,
119in which one of the values
120.Dv KB_SUN2 ,
121.Dv KB_SUN3
122or
123.Dv KB_SUN4
124will be returned.
125.It KIOCSDIRECT
126Route the keyboard input stream through the
127.Tn SunOS
128compatible event module.
129The argument is of type
130.Fa "int *" ,
131a non-zero value will put the driver into
132.Dq event
133mode, while a value of zero will make it return to
134.Dq ASCII translation
135mode.
136.It KIOCSKEY
137Set key station translation.
138The argument is of type
139.Fa "struct kiockey *"
140.Pq see Pa /usr/include/machine/kbio.h No for more details .
141.It KIOCGKEY
142Get key station translation.
143The argument is of type
144.Fa "struct kiockey *" .
145.It KIOCLAYOUT
146Get keyboard layout
147.Pq Do type 4 Dc only .
148The argument is of type
149.Fa "int *" ,
150in which the uninterpreted result of the
151.Dv KBD_CMD_GLAYOUT
152keyboard command is returned
153.Po on Dv KBDUN4
154type keyboards this will be the setting of a DIP switch bank
155.Pc .
156.It KIOCSLED
157Set LED state
158.Pq Do type 4 Dc only .
159The argument is of type
160.Fa "char *" ,
161and is the inclusive OR of the following flags:
162.Pp
163.Bl -tag -width LED_SCROLL_LOCK -compact
164.It LED_NUM_LOCK
165.It LED_COMPOSE
166.It LED_SCROLL_LOCK
167.It LED_CAPS_LOCK
168.El
169.Pp
170Each of these flags turn on the LED in the obvious key.
171.It KIOCGLED
172Get LED state
173.Pq Do type 4 Dc only .
174The argument is of type
175.Fa "char *" ,
176in which the current LED state is returned.
177.El
178.Sh SEE ALSO
179.Xr ms 4
180.Sh BUGS
181.Nm
182is hardwired to the built-in
183.Em zs1
184serial port at 1200 bps.
185