KBD(4)                OpenBSD Programmer's Manual (SPARC)               KBD(4)

NAME
     kbd - workstation keyboard

SYNOPSIS
     pseudo-device kbd

DESCRIPTION
     The kbd driver provides an interface to the workstation console keyboard.
     ``type 2'', ``type 3'', and ``type 4'' keyboards are supported. All types
     generate keycodes encoding the key identity and motion (up or down) as
     the keys are pressed and released.  The kbd driver either passes the key-
     codes to an application as they come in, or translates them into ASCII
     characters first according to a set of built-in tables.  If the keyboard
     is configured as the device to be used for system console input (see
     openprom(4)), it will be internally connected to the /dev/console device
     special file, which can be used as a tty(4) device.  The device special
     file /dev/kbd is used to get direct access to the keyboard input stream.
     The following ioctl's are supported (mostly just enough to keep the X11
     server going):

     KIOCTRANS    Set translation mode. The argument is of type int *, the on-
                  ly value supported is TR_UNTRANS_EVENT.

     KIOCGTRANS   Get translation mode. The argument is of type int *.
                  TR_UNTRANS_EVENT is always returned.

     KIOCGETKEY   Fill in old-style key station translation. The argument is
                  of type struct okiockey *.

     KIOCCMD      Send a command to the keyboard. The argument is of type int
                  *, and can have one of the following values:

                  KBD_CMD_BELL     Start the keyboard beeper.

                  KBD_CMD_NOBELL   Stop the keyboard beeper.

                  KBD_CMD_CLICK    Instruct the keyboard to make extra noise
                                   when touching keys.

                  KBD_CMD_NOCLICK  Instruct the keyboard to.. oh well..

     KIOCTYPE     Get keyboard type. The argument is of type int *, in which
                  one of the values KB_SUN2, KB_SUN3 or KB_SUN4 will be re-
                  turned.

     KIOCSDIRECT  Route the keyboard input stream through the (SunOS) compati-
                  ble event module.  The argument is of type int *, a non-zero
                  value will put the driver into ``event'' mode, while a value
                  of zero will make it return to ``ASCII translation'' mode.

     KIOCSKEY     Set key station translation. The argument is of type struct
                  kiockey * (see /usr/include/machine/kbio.h for more
                  details).

     KIOCGKEY     Get key station translation. The argument is of type struct
                  kiockey *.

     KIOCLAYOUT   Get keyboard layout (``type 4'' only). The argument is of
                  type char *, in which the uninterpreted result of the
                  KBD_CMD_GLAYOUT keyboard command is returned (on KBDUN4type
                  keyboards this will be the setting of a DIP switch bank).

     KIOCSLED     Set LED state (``type 4'' only). The argument is of type
                  char *, and is the inclusive OR of the following flags:

                  LED_NUM_LOCK
                  LED_COMPOSE
                  LED_SCROLL_LOCK
                  LED_CAPS_LOCK

                  Each of these flags turn on the LED in the obvious key.

     KIOCGLED     Get LED state (``type 4'' only). The argument is of type
                  char *, in which the current LED state is returned.

SEE ALSO
     ms(4), zs(4)

BUGS
     kbd is hardwired to the built-in zs1 serial port.

OpenBSD 2.9                      June 22, 1996                               2
