1.\" $NetBSD: kbd.4,v 1.6 1999/12/17 16:23:25 abs 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 sparc 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. 49The 50.Tn Sun 51.Qq type 2 , 52.Qq type 3 , 53.Qq type 4 , 54and 55.Qq type 5 56keyboards are supported. 57The 58.Qq type 5 59keyboard is treated as if it were a 60.Qq type 4 . 61All types generate keycodes encoding the 62key identity and motion (up or down) as the keys are pressed and released. 63The 64.Nm 65driver either passes the keycodes to an application as they come in 66.Pq e.g. Xr X 1 , 67or translates them into 68.Tn ASCII 69characters first according to a set of built-in tables. 70.Pp 71If the 72.Nm 73is configured as the device to be used for system console input 74.Pq see Xr openprom 4 , 75it will be internally connected to the 76.Pa /dev/console 77device special file, which can be used as a 78.Xr tty 4 79device. 80.Pp 81The device special file 82.Pa /dev/kbd 83is used to get direct access to the keyboard input stream. 84.Pp 85The following 86ioctl's are supported (mostly just enough to keep the 87.Xr X 1 88server going): 89.Bl -tag -width KIOCSDIRECT 90.It KIOCTRANS 91Set translation mode. 92The argument is of type 93.Fa "int *" , 94the only value supported is 95.Dv TR_UNTRANS_EVENT . 96.It KIOCGTRANS 97Get translation mode. 98The argument is of type 99.Fa "int *" . 100.Dv TR_UNTRANS_EVENT 101is always returned. 102.It KIOCGETKEY 103Fill in old-style key station translation. 104The argument is of type 105.Fa "struct okiockey *" . 106.It KIOCCMD 107Send a command to the keyboard. 108The argument is of type 109.Fa "int *" , 110and can have one of the following values: 111.Bl -tag -width KBD_CMD_NOCLICK 112.It KBD_CMD_BELL 113Start the keyboard beeper. 114.It KBD_CMD_NOBELL 115Stop the keyboard beeper. 116.It KBD_CMD_CLICK 117Instruct the keyboard to make extra noise when touching keys. 118.It KBD_CMD_NOCLICK 119Instruct the keyboard to stop making extra noise when touching keys. 120.El 121.It KIOCTYPE 122Get keyboard type. 123The argument is of type 124.Fa "int *" , 125in which one of the values 126.Dv KB_SUN2 , 127.Dv KB_SUN3 128or 129.Dv KB_SUN4 130will be returned. 131.It KIOCSDIRECT 132Route the keyboard input stream through the 133.Tn SunOS 134compatible event module. 135The argument is of type 136.Fa "int *" , 137a non-zero value will put the driver into 138.Qq event 139mode, while a value of zero will make it return to 140.Qq ASCII translation 141mode. 142.It KIOCSKEY 143Set key station translation. 144The argument is of type 145.Fa "struct kiockey *" 146.Pq see Pa /usr/include/machine/kbio.h No for more details . 147.It KIOCGKEY 148Get key station translation. 149The argument is of type 150.Fa "struct kiockey *" . 151.It KIOCLAYOUT 152Get keyboard layout 153.Pq Do type 4 Dc only . 154The argument is of type 155.Fa "int *" , 156in which the uninterpreted result of the 157.Dv KBD_CMD_GLAYOUT 158keyboard command is returned 159.Po on Dv KB_SUN4 160type keyboards this will be the setting of a DIP switch bank 161.Pc . 162.It KIOCSLED 163Set LED state 164.Pq Do type 4 Dc only . 165The argument is of type 166.Fa "char *" , 167and is the inclusive OR of the following flags: 168.Pp 169.Bl -tag -width LED_SCROLL_LOCK -compact 170.It LED_NUM_LOCK 171.It LED_COMPOSE 172.It LED_SCROLL_LOCK 173.It LED_CAPS_LOCK 174.El 175.Pp 176Each of these flags turn on the LED in the obvious key. 177.It KIOCGLED 178Get LED state 179.Pq Do type 4 Dc only . 180The argument is of type 181.Fa "char *" , 182in which the current LED state is returned. 183.El 184.Sh SEE ALSO 185.Xr ms 4 186.Sh BUGS 187.Nm 188is hardwired to the built-in 189.Em zs1 190serial port at 1200 bps. 191