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