1999-12-17 19:53:31 +03:00
|
|
|
.\" $NetBSD: kbd.4,v 1.7 1999/12/17 16:53:33 abs Exp $
|
1996-06-23 01:35:14 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Paul Kranenburg.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the NetBSD
|
|
|
|
.\" Foundation, Inc. and its contributors.
|
|
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
.\" contributors may be used to endorse or promote products derived
|
|
|
|
.\" from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
1998-06-11 13:03:45 +04:00
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
1997-10-09 01:59:52 +04:00
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
1996-06-23 01:35:14 +04:00
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.Dd June 22, 1996
|
1997-10-23 02:55:44 +04:00
|
|
|
.Dt KBD 4 sun3
|
1996-06-23 01:35:14 +04:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm kbd
|
1999-12-17 19:53:31 +03:00
|
|
|
.Nd Sun workstation keyboard
|
1996-06-23 01:35:14 +04:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Cd "pseudo-device kbd"
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver provides an interface to the workstation console keyboard.
|
1998-06-11 13:03:45 +04:00
|
|
|
.Qq type 2 ,
|
|
|
|
.Qq type 3 ,
|
|
|
|
.Qq type 4 ,
|
1996-06-23 01:35:14 +04:00
|
|
|
and
|
1998-06-11 13:03:45 +04:00
|
|
|
.Qq type 5
|
|
|
|
keyboards are supported.
|
|
|
|
The
|
|
|
|
.Qq type 5
|
|
|
|
keyboard is treated as if it were a
|
|
|
|
.Qq type 4 .
|
|
|
|
All types generate keycodes encoding the
|
1996-06-23 01:35:14 +04:00
|
|
|
key identity and motion (up or down) as the keys are pressed and released.
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver either passes the keycodes to an application as they come in, or
|
1998-06-11 13:03:45 +04:00
|
|
|
translates them into
|
|
|
|
.Tn ASCII
|
|
|
|
characters first according to a set of built-in tables.
|
1998-06-11 13:16:10 +04:00
|
|
|
.Pp
|
1996-06-23 01:35:14 +04:00
|
|
|
If the keyboard is configured as the device
|
|
|
|
to be used for system console input
|
1998-06-11 13:16:10 +04:00
|
|
|
.Pq see Xr eeprom 8 ,
|
1996-06-23 01:35:14 +04:00
|
|
|
it will be internally connected to the
|
|
|
|
.Pa /dev/console
|
|
|
|
device special file, which can be used as a
|
|
|
|
.Xr tty 4
|
|
|
|
device.
|
1998-06-11 13:16:10 +04:00
|
|
|
.Pp
|
1996-06-23 01:35:14 +04:00
|
|
|
The device special file
|
|
|
|
.Pa /dev/kbd
|
1998-06-11 13:03:45 +04:00
|
|
|
is used to get direct access to the keyboard input stream.
|
|
|
|
The following
|
|
|
|
ioctl's are supported (mostly just enough to keep the
|
|
|
|
.Xr X 1
|
|
|
|
server going):
|
1996-06-23 01:35:14 +04:00
|
|
|
.Bl -tag -width KIOCSDIRECT
|
|
|
|
.It KIOCTRANS
|
1998-06-11 13:03:45 +04:00
|
|
|
Set translation mode.
|
|
|
|
The argument is of type
|
1996-06-23 01:35:14 +04:00
|
|
|
.Fa "int *" ,
|
|
|
|
the only value supported is
|
|
|
|
.Dv TR_UNTRANS_EVENT .
|
|
|
|
.It KIOCGTRANS
|
1998-06-11 13:03:45 +04:00
|
|
|
Get translation mode.
|
|
|
|
The argument is of type
|
1996-06-23 01:35:14 +04:00
|
|
|
.Fa "int *" .
|
|
|
|
.Dv TR_UNTRANS_EVENT
|
|
|
|
is always returned.
|
|
|
|
.It KIOCGETKEY
|
1998-06-11 13:03:45 +04:00
|
|
|
Fill in old-style key station translation.
|
|
|
|
The argument is of type
|
1996-06-23 01:35:14 +04:00
|
|
|
.Fa "struct okiockey *" .
|
|
|
|
.It KIOCCMD
|
1998-06-11 13:03:45 +04:00
|
|
|
Send a command to the keyboard.
|
|
|
|
The argument is of type
|
1996-06-23 01:35:14 +04:00
|
|
|
.Fa "int *" ,
|
|
|
|
and can have one of the following values:
|
|
|
|
.Bl -tag -width KBD_CMD_NOCLICK
|
|
|
|
.It KBD_CMD_BELL
|
|
|
|
Start the keyboard beeper.
|
|
|
|
.It KBD_CMD_NOBELL
|
|
|
|
Stop the keyboard beeper.
|
|
|
|
.It KBD_CMD_CLICK
|
|
|
|
Instruct the keyboard to make extra noise when touching keys.
|
|
|
|
.It KBD_CMD_NOCLICK
|
1998-06-11 13:03:45 +04:00
|
|
|
Instruct the keyboard to stop making extra noise when touching keys.
|
1996-06-23 01:35:14 +04:00
|
|
|
.El
|
|
|
|
.It KIOCTYPE
|
1998-06-11 13:03:45 +04:00
|
|
|
Get keyboard type.
|
|
|
|
The argument is of type
|
1996-06-23 01:35:14 +04:00
|
|
|
.Fa "int *" ,
|
|
|
|
in which one of the values
|
|
|
|
.Dv KB_SUN2 ,
|
|
|
|
.Dv KB_SUN3
|
|
|
|
or
|
|
|
|
.Dv KB_SUN4
|
|
|
|
will be returned.
|
|
|
|
.It KIOCSDIRECT
|
1998-06-11 13:03:45 +04:00
|
|
|
Route the keyboard input stream through the
|
|
|
|
.Tn SunOS
|
|
|
|
compatible event module.
|
1996-06-23 01:35:14 +04:00
|
|
|
The argument is of type
|
|
|
|
.Fa "int *" ,
|
|
|
|
a non-zero value will put the driver into
|
|
|
|
.Dq event
|
|
|
|
mode, while a value of zero will make it return to
|
|
|
|
.Dq ASCII translation
|
|
|
|
mode.
|
|
|
|
.It KIOCSKEY
|
1998-06-11 13:03:45 +04:00
|
|
|
Set key station translation.
|
|
|
|
The argument is of type
|
|
|
|
.Fa "struct kiockey *"
|
1996-06-23 01:35:14 +04:00
|
|
|
.Pq see Pa /usr/include/machine/kbio.h No for more details .
|
|
|
|
.It KIOCGKEY
|
1998-06-11 13:03:45 +04:00
|
|
|
Get key station translation.
|
|
|
|
The argument is of type
|
1996-06-23 01:35:14 +04:00
|
|
|
.Fa "struct kiockey *" .
|
|
|
|
.It KIOCLAYOUT
|
|
|
|
Get keyboard layout
|
|
|
|
.Pq Do type 4 Dc only .
|
|
|
|
The argument is of type
|
|
|
|
.Fa "int *" ,
|
|
|
|
in which the uninterpreted result of the
|
|
|
|
.Dv KBD_CMD_GLAYOUT
|
|
|
|
keyboard command is returned
|
|
|
|
.Po on Dv KBDUN4
|
|
|
|
type keyboards this will be the setting of a DIP switch bank
|
|
|
|
.Pc .
|
|
|
|
.It KIOCSLED
|
|
|
|
Set LED state
|
|
|
|
.Pq Do type 4 Dc only .
|
|
|
|
The argument is of type
|
1997-11-26 01:15:56 +03:00
|
|
|
.Fa "char *" ,
|
1996-06-23 01:35:14 +04:00
|
|
|
and is the inclusive OR of the following flags:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width LED_SCROLL_LOCK -compact
|
|
|
|
.It LED_NUM_LOCK
|
|
|
|
.It LED_COMPOSE
|
|
|
|
.It LED_SCROLL_LOCK
|
|
|
|
.It LED_CAPS_LOCK
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Each of these flags turn on the LED in the obvious key.
|
1997-11-26 01:15:56 +03:00
|
|
|
.It KIOCGLED
|
1996-06-23 01:35:14 +04:00
|
|
|
Get LED state
|
|
|
|
.Pq Do type 4 Dc only .
|
|
|
|
The argument is of type
|
1997-11-26 01:15:56 +03:00
|
|
|
.Fa "char *" ,
|
1996-06-23 01:35:14 +04:00
|
|
|
in which the current LED state is returned.
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
1998-06-11 13:16:10 +04:00
|
|
|
.Xr ms 4 ,
|
|
|
|
.Xr eeprom 4 ,
|
|
|
|
.Xr eeprom 8
|
1996-06-23 01:35:14 +04:00
|
|
|
.Sh BUGS
|
|
|
|
.Nm
|
|
|
|
is hardwired to the built-in
|
|
|
|
.Em zs1
|
1998-06-11 13:03:45 +04:00
|
|
|
serial port at 1200 bps.
|