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