xref: /netbsd/share/man/man4/man4.sun3/kbd.4 (revision bf9ec67e)
1.\"	$NetBSD: kbd.4,v 1.8 2002/01/15 02:03:07 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 sun3
39.Os
40.Sh NAME
41.Nm kbd
42.Nd Sun workstation keyboard
43.Sh SYNOPSIS
44.Cd "pseudo-device kbd"
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
70.Pq see Xr eeprom 8 ,
71it will be internally connected to the
72.Pa /dev/console
73device special file, which can be used as a
74.Xr tty 4
75device.
76.Pp
77The device special file
78.Pa /dev/kbd
79is used to get direct access to the keyboard input stream.
80The following
81ioctl's are supported (mostly just enough to keep the
82.Xr X 1
83server going):
84.Bl -tag -width KIOCSDIRECT
85.It KIOCTRANS
86Set translation mode.
87The argument is of type
88.Fa "int *" ,
89the only value supported is
90.Dv TR_UNTRANS_EVENT .
91.It KIOCGTRANS
92Get translation mode.
93The argument is of type
94.Fa "int *" .
95.Dv TR_UNTRANS_EVENT
96is always returned.
97.It KIOCGETKEY
98Fill in old-style key station translation.
99The argument is of type
100.Fa "struct okiockey *" .
101.It KIOCCMD
102Send a command to the keyboard.
103The argument is of type
104.Fa "int *" ,
105and can have one of the following values:
106.Bl -tag -width KBD_CMD_NOCLICK
107.It KBD_CMD_BELL
108Start the keyboard beeper.
109.It KBD_CMD_NOBELL
110Stop the keyboard beeper.
111.It KBD_CMD_CLICK
112Instruct the keyboard to make extra noise when touching keys.
113.It KBD_CMD_NOCLICK
114Instruct the keyboard to stop making extra noise when touching keys.
115.El
116.It KIOCTYPE
117Get keyboard type.
118The argument is of type
119.Fa "int *" ,
120in which one of the values
121.Dv KB_SUN2 ,
122.Dv KB_SUN3
123or
124.Dv KB_SUN4
125will be returned.
126.It KIOCSDIRECT
127Route the keyboard input stream through the
128.Tn SunOS
129compatible event module.
130The argument is of type
131.Fa "int *" ,
132a non-zero value will put the driver into
133.Dq event
134mode, while a value of zero will make it return to
135.Dq ASCII translation
136mode.
137.It KIOCSKEY
138Set key station translation.
139The argument is of type
140.Fa "struct kiockey *"
141.Pq see Pa /usr/include/machine/kbio.h No for more details .
142.It KIOCGKEY
143Get key station translation.
144The argument is of type
145.Fa "struct kiockey *" .
146.It KIOCLAYOUT
147Get keyboard layout
148.Pq Do type 4 Dc only .
149The argument is of type
150.Fa "int *" ,
151in which the uninterpreted result of the
152.Dv KBD_CMD_GLAYOUT
153keyboard command is returned
154.Po on Dv KBDUN4
155type keyboards this will be the setting of a DIP switch bank
156.Pc .
157.It KIOCSLED
158Set LED state
159.Pq Do type 4 Dc only .
160The argument is of type
161.Fa "char *" ,
162and is the inclusive OR of the following flags:
163.Pp
164.Bl -tag -width LED_SCROLL_LOCK -compact
165.It LED_NUM_LOCK
166.It LED_COMPOSE
167.It LED_SCROLL_LOCK
168.It LED_CAPS_LOCK
169.El
170.Pp
171Each of these flags turn on the LED in the obvious key.
172.It KIOCGLED
173Get LED state
174.Pq Do type 4 Dc only .
175The argument is of type
176.Fa "char *" ,
177in which the current LED state is returned.
178.El
179.Sh SEE ALSO
180.Xr eeprom 4 ,
181.Xr ms 4 ,
182.Xr eeprom 8
183.Sh BUGS
184.Nm
185is hardwired to the built-in
186.Em zs1
187serial port at 1200 bps.
188