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