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