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