'\" te
.\"  All Rights Reserved Copyright (c) 2004, Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH KB 7M "Feb 26, 2004"
.SH NAME
kb \- keyboard STREAMS module
.SH SYNOPSIS
.LP
.nf
#include <sys/types.h>
.fi

.LP
.nf
#include <sys/stream.h>
.fi

.LP
.nf
#include <sys/stropts.h>
.fi

.LP
.nf
#include <sys/vuid_event.h>
.fi

.LP
.nf
#include <sys/kbio.h>
.fi

.LP
.nf
#include <sys/kbd.h>
.fi

.LP
.nf
ioctl(fd, I_PUSH, "kb");
.fi

.SH DESCRIPTION
.sp
.LP
The \fBkb\fR STREAMS module processes byte streams generated by a keyboard
attached to a \fBCPU\fR serial port. Definitions for altering keyboard
translation and reading events from the keyboard are contained in
<\fBsys/kbio.h\fR> and <\fBsys/kbd.h\fR>.
.sp
.LP
The \fBkb\fR STREAMS module utilizes a set of keyboard tables to recognize
which keys have been typed. Each translation table is an array of 128 16-bit
words (\fBunsigned short\fRs). If a table entry is less than 0x100, the entry
is treated as an \fBISO\fR 8859/1 character. Higher values indicate special
characters that invoke more complicated actions.
.SS "Keyboard Translation Mode"
.sp
.LP
The keyboard can be in one of the following translation modes:
.sp
.ne 2
.na
\fB\fBTR_NONE\fR \fR
.ad
.RS 21n
Keyboard translation is turned off and up/down key codes are reported.
.RE

.sp
.ne 2
.na
\fB\fBTR_ASCII\fR \fR
.ad
.RS 21n
\fBISO\fR 8859/1 codes are reported.
.RE

.sp
.ne 2
.na
\fB\fBTR_EVENT\fR \fR
.ad
.RS 21n
\fBfirm_events\fR are reported.
.RE

.sp
.ne 2
.na
\fB\fBTR_UNTRANS_EVENT\fR \fR
.ad
.RS 21n
\fBfirm_events\fR containing unencoded keystation codes are reported for all
input events within the window system.
.RE

.SS "Keyboard Translation-Table Entries"
.sp
.LP
All instances of the \fBkb\fR module share seven translation tables that
convert raw keystation codes to event values. The tables are:
.sp
.ne 2
.na
\fBUnshifted\fR
.ad
.RS 14n
Used when a key is depressed and no shifts are in effect.
.RE

.sp
.ne 2
.na
\fBShifted\fR
.ad
.RS 14n
Used when a key is depressed and a Shift key is held down.
.RE

.sp
.ne 2
.na
\fBCaps Lock\fR
.ad
.RS 14n
Used when a key is depressed and Caps Lock is in effect.
.RE

.sp
.ne 2
.na
\fBAlt Graph\fR
.ad
.RS 14n
Used when a key is depressed and the Alt Graph key is held down.
.RE

.sp
.ne 2
.na
\fBNum Lock\fR
.ad
.RS 14n
Used when a key is depressed and Num Lock is in effect.
.RE

.sp
.ne 2
.na
\fBControlled\fR
.ad
.RS 14n
Used when a key is depressed and the Control key is held down. (Regardless of
whether a Shift key or the Alt Graph is being held down, or whether Caps Lock
or Num Lock is in effect).
.RE

.sp
.ne 2
.na
\fBKey Up\fR
.ad
.RS 14n
Used when a key is released.
.RE

.sp
.LP
Each key on the keyboard has a \fBkey station\fR code that represents a number
from 0 to 127. The number is used as an index into the translation table that
is currently in effect. If the corresponding entry in the translation table is
a value from 0 to 255, the value is treated as an \fBISO\fR 8859/1 character,
and the character is the result of the translation.
.sp
.LP
If the entry in the translation table is higher than 255, it is a special
entry. Special entry values are classified according to the value of the
high-order bits. The high-order value for each class is defined as a constant,
as shown below. When added to the constant, the value of the low-order bits
distinguish between keys within each class:
.sp
.ne 2
.na
\fBSHIFTKEYS 0x100 \fR
.ad
.RS 20n
A shift key. The value of the particular shift key is added to determine which
shift mask to apply:
.sp
.ne 2
.na
\fB\fBCAPSLOCK 0\fR \fR
.ad
.RS 17n
Caps Lock key.
.RE

.sp
.ne 2
.na
\fB\fBSHIFTLOCK 1\fR \fR
.ad
.RS 17n
"Shift Lock" key.
.RE

.sp
.ne 2
.na
\fB\fBLEFTSHIFT 2\fR \fR
.ad
.RS 17n
Left-hand Shift key.
.RE

.sp
.ne 2
.na
\fB\fBRIGHTSHIFT 3\fR \fR
.ad
.RS 17n
Right-hand Shift key.
.RE

.sp
.ne 2
.na
\fB\fBLEFTCTRL 4\fR \fR
.ad
.RS 17n
Left-hand (or only) Control key.
.RE

.sp
.ne 2
.na
\fB\fBRIGHTCTRL 5\fR \fR
.ad
.RS 17n
Right-hand Control key.
.RE

.sp
.ne 2
.na
\fB\fBALTGRAPH 9\fR \fR
.ad
.RS 17n
 Alt Graph key.
.RE

.sp
.ne 2
.na
\fB\fBALT 10\fR \fR
.ad
.RS 17n
 Alternate or Alt key.
.RE

.sp
.ne 2
.na
\fB\fBNUMLOCK 11\fR \fR
.ad
.RS 17n
 Num Lock key.
.RE

.RE

.sp
.ne 2
.na
\fB\fBBUCKYBITS 0x200\fR \fR
.ad
.RS 20n
Used to toggle mode-key-up/down status without altering the value of an
accompanying \fBISO\fR 8859/1 character. The actual bit-position value, minus
7, is added.
.sp
.ne 2
.na
\fB\fBMETABIT 0\fR \fR
.ad
.RS 16n
The Meta key was pressed along with the key. This is the only user-accessible
bucky bit. It is ORed in as the 0x80 bit; since this bit is a legitimate bit in
a character, the only way to distinguish between, for example, 0xA0 as
\fBMETA+0x20\fR and 0xA0 as an 8-bit character is to watch for META key up and
META key down events and keep track of whether the \fBMETA\fR key was down.
.RE

.sp
.ne 2
.na
\fB\fBSYSTEMBIT 1\fR \fR
.ad
.RS 16n
The System key was pressed. This is a place holder to indicate which key is the
system-abort key.
.RE

.RE

.sp
.ne 2
.na
\fB\fBFUNNY 0x300\fR \fR
.ad
.RS 20n
Performs various functions depending on the value of the low 4 bits:
.sp
.ne 2
.na
\fB\fBNOP 0x300\fR \fR
.ad
.RS 20n
Does nothing.
.RE

.sp
.ne 2
.na
\fB\fBOOPS 0x301\fR \fR
.ad
.RS 20n
Exists, but is undefined.
.RE

.sp
.ne 2
.na
\fB\fBHOLE 0x302\fR \fR
.ad
.RS 20n
There is no key in this position on the keyboard, and the position-code should
not be used.
.RE

.sp
.ne 2
.na
\fB\fBRESET 0x306\fR \fR
.ad
.RS 20n
Keyboard reset.
.RE

.sp
.ne 2
.na
\fB\fBERROR 0x307\fR \fR
.ad
.RS 20n
The keyboard driver detected an internal error.
.RE

.sp
.ne 2
.na
\fB\fBIDLE 0x308\fR \fR
.ad
.RS 20n
The keyboard is idle (no keys down).
.RE

.sp
.ne 2
.na
\fB\fBCOMPOSE 0x309\fR \fR
.ad
.RS 20n
The \fBCOMPOSE\fR key; the next two keys should comprise a two-character
COMPOSE key sequence.
.RE

.sp
.ne 2
.na
\fB\fBNONL 0x30A\fR \fR
.ad
.RS 20n
Used only in the Num Lock table; indicates that this key is not affected by the
Num Lock state, so that the translation table to use to translate this key
should be the one that would have been used had Num Lock not been in effect.
.RE

.sp
.ne 2
.na
\fB0x30B \(em 0x30F\fR
.ad
.RS 20n
Reserved for non-parameterized functions.
.RE

.RE

.sp
.ne 2
.na
\fB\fBFA_CLASS 0x400\fR \fR
.ad
.RS 20n
A floating accent or "dead key." When this key is pressed, the next key
generates an event for an accented character; for example, "floating accent
grave" followed by the "a" key generates an event with the \fBISO\fR 8859/1
code for the "a with grave accent" character. The low-order bits indicate which
accent; the codes for the individual "floating accents" are as follows:
.sp
.ne 2
.na
\fB\fBFA_UMLAUT 0x400\fR \fR
.ad
.RS 21n
umlaut
.RE

.sp
.ne 2
.na
\fB\fBFA_CFLEX 0x401\fR \fR
.ad
.RS 21n
circumflex
.RE

.sp
.ne 2
.na
\fB\fBFA_TILDE 0x402\fR \fR
.ad
.RS 21n
tilde
.RE

.sp
.ne 2
.na
\fB\fBFA_CEDILLA 0x403\fR \fR
.ad
.RS 21n
cedilla
.RE

.sp
.ne 2
.na
\fB\fBFA_ACUTE 0x404\fR \fR
.ad
.RS 21n
acute accent
.RE

.sp
.ne 2
.na
\fB\fBFA_GRAVE 0x405\fR \fR
.ad
.RS 21n
grave accent
.RE

.RE

.sp
.ne 2
.na
\fB\fBSTRING 0x500\fR \fR
.ad
.RS 20n
The low-order bits index a table of strings. When a key with a \fBSTRING\fR
entry is depressed, the characters in the null-terminated string for that key
are sent, character-by-character. The maximum length is defined as:
.sp
.ne 2
.na
\fBKTAB_STRLEN \fR
.ad
.RS 16n
10
.RE

Individual string numbers are defined as:
.sp
.ne 2
.na
\fBHOMEARROW \fR
.ad
.RS 15n
0x00
.RE

.sp
.ne 2
.na
\fB\fBUPARROW\fR \fR
.ad
.RS 15n
0x01
.RE

.sp
.ne 2
.na
\fB\fBDOWNARROW\fR \fR
.ad
.RS 15n
0x02
.RE

.sp
.ne 2
.na
\fB\fBLEFTARROW\fR \fR
.ad
.RS 15n
0x03
.RE

.sp
.ne 2
.na
\fB\fBRIGHTARROW\fR \fR
.ad
.RS 15n
0x04
.RE

String numbers 0x05 \(em 0x0F are available for custom entries.
.RE

.sp
.ne 2
.na
\fB\fBFUNCKEYS 0x600\fR \fR
.ad
.RS 20n
There are 64 keys reserved for function keys. The actual positions are usually
on the left/right/top/bottom of the keyboard.
.sp
The next-to-lowest 4 bits indicate the group of function keys:
.sp
.ne 2
.na
\fB\fBLEFTFUNC \fR \fR
.ad
.RS 18n
0x600
.RE

.sp
.ne 2
.na
\fB\fBRIGHTFUNC \fR \fR
.ad
.RS 18n
0x610
.RE

.sp
.ne 2
.na
\fB\fBTOPFUNC 0x610\fR \fR
.ad
.RS 18n
0x610
.RE

.sp
.ne 2
.na
\fB\fBBOTTOMFUNC \fR \fR
.ad
.RS 18n
0x630
.RE

The low 4 bits indicate the function key number within the group:
.sp
.ne 2
.na
\fBLF(\fIn\fR)\fR
.ad
.RS 10n
(LEFTFUNC+(\fIn\fR)-1)
.RE

.sp
.ne 2
.na
\fBRF(\fIn\fR) \fR
.ad
.RS 10n
(RIGHTFUNC+(\fIn\fR)-1)
.RE

.sp
.ne 2
.na
\fBTF(\fIn\fR) \fR
.ad
.RS 10n
(TOPFUNC+(\fIn\fR)-1)
.RE

.sp
.ne 2
.na
\fBBF(\fIn\fR) \fR
.ad
.RS 10n
(BOTTOMFUNC+(\fIn\fR)-1)
.RE

.RE

.sp
.ne 2
.na
\fB\fBPADKEYS 0x700\fR \fR
.ad
.RS 18n
A "numeric keypad key." These entries should appear only in the Num Lock
translation table; when Num Lock is in effect, these events will be generated
by pressing keys on the right-hand keypad. The low-order bits indicate which
key. The codes for the individual keys are:
.sp
.ne 2
.na
\fB\fBPADEQUAL 0x700\fR \fR
.ad
.RS 19n
"=" key
.RE

.sp
.ne 2
.na
\fB\fBPADSLASH 0x701\fR \fR
.ad
.RS 19n
"/" key
.RE

.sp
.ne 2
.na
\fB\fBPADSTAR 0x702\fR \fR
.ad
.RS 19n
"*" key
.RE

.sp
.ne 2
.na
\fB\fBPADMINUS 0x703\fR \fR
.ad
.RS 19n
"-" key
.RE

.sp
.ne 2
.na
\fB\fBPADSEP 0x704\fR \fR
.ad
.RS 19n
"," key
.RE

.sp
.ne 2
.na
\fB\fBPAD7 0x705\fR \fR
.ad
.RS 19n
"7" key
.RE

.sp
.ne 2
.na
\fB\fBPAD8 0x706\fR \fR
.ad
.RS 19n
"8" key
.RE

.sp
.ne 2
.na
\fB\fBPAD9 0x707\fR \fR
.ad
.RS 19n
"9" key
.RE

.sp
.ne 2
.na
\fB\fBPADPLUS 0x708\fR \fR
.ad
.RS 19n
"+" key
.RE

.sp
.ne 2
.na
\fB\fBPAD4 0x709\fR \fR
.ad
.RS 19n
"4" key
.RE

.sp
.ne 2
.na
\fB\fBPAD5 0x70A\fR \fR
.ad
.RS 19n
"5" key
.RE

.sp
.ne 2
.na
\fB\fBPAD6 0x70B\fR \fR
.ad
.RS 19n
"6" key
.RE

.sp
.ne 2
.na
\fB\fBPAD1 0x70C\fR \fR
.ad
.RS 19n
"1" key
.RE

.sp
.ne 2
.na
\fB\fBPAD2 0x70D\fR \fR
.ad
.RS 19n
"2" key
.RE

.sp
.ne 2
.na
\fB\fBPAD3 0x70E\fR \fR
.ad
.RS 19n
"3" key
.RE

.sp
.ne 2
.na
\fB\fBPAD0 0x70F\fR \fR
.ad
.RS 19n
"0" key
.RE

.sp
.ne 2
.na
\fB\fBPADDOT 0x710\fR \fR
.ad
.RS 19n
"." key
.RE

.sp
.ne 2
.na
\fB\fBPADENTER 0x711\fR \fR
.ad
.RS 19n
"Enter" key
.RE

.RE

.sp
.LP
When a function key is pressed in \fBTR_ASCII\fR mode, the following escape
sequence is sent:
.sp
.LP
\fBESC[0\|.\|.\|..\|9z\fR
.sp
.LP
where  \fBESC\fR is a single escape character and "0\|.\|..\|9" indicates the
decimal representation of the function-key value. For example, function key
\fBR1\fR sends the sequence:
.sp
.LP
\fBESC[208z\fR
.sp
.LP
because the decimal value of RF(1) is 208. In \fBTR_EVENT\fR mode, if there is
a \fBVUID\fR event code for the function key in question, an event with that
event code is generated; otherwise, individual events for the characters of the
escape sequence are generated.
.SS "Keyboard Compatibility Mode"
.sp
.LP
When started, the \fBkb\fR STREAMS module is in the compatibility mode. When
the keyboard is in the \fBTR_EVENT\fR translation mode, \fBISO\fR 8859/1
characters from the upper half of the character set (that is, characters with
the eighth bit set) , are presented as events with codes in the \fBISO_FIRST\fR
range (as defined in <\fB<sys/vuid_event.h>\fR>). For backwards compatibility
with older versions of the keyboard driver, the event code is \fBISO_FIRST\fR
plus the character value. When compatibility mode is turned off, \fBISO\fR
8859/1 characters are presented as events with codes equal to the character
code.
.SH DESCRIPTION
.sp
.LP
The following \fBioctl()\fR requests set and retrieve the current translation
mode of a keyboard:
.sp
.ne 2
.na
\fB\fBKIOCTRANS\fR \fR
.ad
.RS 15n
Pointer to an \fBint\fR. The translation mode is set to the value in the
\fBint\fR pointed to by the argument.
.RE

.sp
.ne 2
.na
\fB\fBKIOCGTRANS\fR \fR
.ad
.RS 15n
Pointer to an \fBint\fR. The current translation mode is stored in the
\fBint\fR pointed to by the argument.
.RE

.sp
.LP
\fBioctl()\fR requests for changing and retrieving entries from the keyboard
translation table use the \fBkiockeymap\fR structure:
.sp
.in +2
.nf
struct kiockeymap {
int	kio_tablemask;	/* Translation table (one of: 0, CAPSMASK,
			 * SHIFTMASK, CTRLMASK, UPMASK,
			 * ALTGRAPHMASK, NUMLOCKMASK)
			 */
#define KIOCABORT1 -1	  /* Special "mask": abort1 keystation */
#define KIOCABORT2 -2	  /* Special "mask": abort2 keystation */
	uchar_t kio_station; /* Physical keyboard key station (0-127) */
	ushort_t kio_entry;	   /* Translation table station's entry */
	char kio_string[10]; /* Value for STRING entries-null terminated */
};
.fi
.in -2

.sp
.ne 2
.na
\fB\fBKIOCSKEY\fR \fR
.ad
.RS 13n
Pointer to a \fBkiockeymap\fR structure. The translation table entry referred
to by the values in that structure is changed. The \fBkio_tablemask\fR request
specifies which of the following translation tables contains the entry to be
modified:
.sp
.ne 2
.na
\fB\fBUPMASK 0x0080\fR \fR
.ad
.sp .6
.RS 4n
"Key Up" translation table.
.RE

.sp
.ne 2
.na
\fB\fBNUMLOCKMASK 0x0800\fR \fR
.ad
.sp .6
.RS 4n
"Num Lock" translation table.
.RE

.sp
.ne 2
.na
\fB\fBCTRLMASK 0x0030\fR \fR
.ad
.sp .6
.RS 4n
"Controlled" translation table.
.RE

.sp
.ne 2
.na
\fB\fBALTGRAPHMASK 0x0200\fR \fR
.ad
.sp .6
.RS 4n
"Alt Graph" translation table.
.RE

.sp
.ne 2
.na
\fB\fBSHIFTMASK 0x000E\fR \fR
.ad
.sp .6
.RS 4n
"Shifted" translation table.
.RE

.sp
.ne 2
.na
\fB\fBCAPSMASK 0x0001\fR \fR
.ad
.sp .6
.RS 4n
"Caps Lock" translation table.
.RE

.sp
.ne 2
.na
\fB(No shift keys pressed or locked)\fR
.ad
.sp .6
.RS 4n
"Unshifted" translation table.
.RE

.RE

.sp
.LP
The \fBkio_station\fR request specifies the keystation code for the entry to be
modified. The value of \fBkio_entry\fR is stored in the entry in question. If
\fBkio_entry\fR is between \fBSTRING\fR and \fBSTRING+15,\fR the string
contained in \fBkio_string\fR is copied to the appropriate string table entry.
This call may return \fBEINVAL\fR if there are invalid arguments.
.sp
.LP
Special values of \fBkio_tablemask\fR can affect the two step "break to the
\fBPROM\fR monitor" sequence. The usual sequence is \fBL1\fR-\fBa\fR or
\fBStop\fR-. If \fBkio_tablemask\fR is \fBKIOCABORT1\fR, then the value of
\fBkio_station\fR is set to be the first keystation in the sequence. If
\fBkio_tablemask\fR, is \fBKIOCABORT2\fR then the value of \fBkio_station\fR is
set to be the second keystation in the sequence. An attempt to change the
"break to the  \fBPROM\fR monitor" sequence without having superuser permission
results in an  \fBEPERM\fR error.
.sp
.ne 2
.na
\fB\fBKIOCGKEY\fR \fR
.ad
.RS 13n
The argument is a pointer to a \fBkiockeymap\fR structure. The current value of
the keyboard translation table entry specified by \fBkio_tablemask\fR and
\fBkio_station\fR is stored in the structure pointed to by the argument. This
call may return \fBEINVAL\fR if there are invalid arguments.
.RE

.sp
.ne 2
.na
\fB\fBKIOCTYPE\fR \fR
.ad
.RS 13n
The argument is a pointer to an \fBint\fR. A code indicating the type of the
keyboard is stored in the \fBint\fR pointed to by the argument:
.sp
.ne 2
.na
\fB\fBKB_SUN3\fR \fR
.ad
.RS 14n
Sun Type 3 keyboard
.RE

.sp
.ne 2
.na
\fB\fBKB_SUN4\fR \fR
.ad
.RS 14n
Sun Type 4 or 5 keyboard, or non-USB Sun Type 6 keyboard
.RE

.sp
.ne 2
.na
\fB\fBKB_USB\fR \fR
.ad
.RS 14n
USB standard HID keyboard, including Sun Type 6 USB keyboards
.RE

.sp
.ne 2
.na
\fB\fBKB_ASCII\fR \fR
.ad
.RS 14n
ASCII terminal masquerading as keyboard
.RE

.sp
.ne 2
.na
\fB\fBKB_PC\fR \fR
.ad
.RS 14n
Type 101 PC keyboard
.RE

.sp
.ne 2
.na
\fB\fBKB_DEFAULT\fR\fR
.ad
.RS 14n
 Stored in the \fBint\fR pointed to by the argument if the keyboard type is
unknown. In case of error, -1 is stored in the \fBint\fR pointed to by the
argument.
.RE

.RE

.sp
.ne 2
.na
\fB\fBKIOCLAYOUT\fR \fR
.ad
.RS 15n
The argument is a pointer to an \fBint\fR. On a Sun Type 4 keyboard, the layout
code specified by the keyboard's \fBDIP\fR switches is stored in the \fBint\fR
pointed to by the argument.
.RE

.sp
.ne 2
.na
\fB\fBKIOCCMD\fR \fR
.ad
.RS 15n
The argument is a pointer to an \fBint\fR. The command specified by the value
of the \fBint\fR pointed to by the argument is sent to the keyboard. The
commands that can be sent are:
.sp
Commands to the Sun Type 3 and Sun Type 4 keyboards:
.sp
.ne 2
.na
\fB\fBKBD_CMD_RESET\fR \fR
.ad
.RS 20n
Reset keyboard as if power-up.
.RE

.sp
.ne 2
.na
\fB\fBKBD_CMD_BELL\fR \fR
.ad
.RS 20n
Turn on the bell.
.RE

.sp
.ne 2
.na
\fB\fBKBD_CMD_NOBELL\fR \fR
.ad
.RS 20n
Turn off the bell.
.RE

.sp
.ne 2
.na
\fB\fBKBD_CMD_CLICK\fR \fR
.ad
.RS 20n
Turn on the click annunciator.
.RE

.sp
.ne 2
.na
\fB\fBKBD_CMD_NOCLICK\fR \fR
.ad
.RS 20n
Turn off the click annunciator.
.RE

Commands to the Sun Type 4 keyboard:
.sp
.ne 2
.na
\fB\fBKBD_CMD_SETLED\fR \fR
.ad
.RS 22n
Set keyboard LEDs.
.RE

.sp
.ne 2
.na
\fB\fBKBD_CMD_GETLAYOUT\fR \fR
.ad
.RS 22n
Request that keyboard indicate layout.
.RE

.RE

.sp
.LP
Inappropriate commands for particular keyboard types are ignored. Since there
is no reliable way to get the state of the bell or click (because the keyboard
cannot be queried and a process could do writes to the appropriate serial
driver \(em circumventing this \fBioctl()\fR request) an equivalent
\fBioctl()\fR to query its state is not provided.
.sp
.ne 2
.na
\fB\fBKIOCSLED\fR \fR
.ad
.RS 13n
The argument is a pointer to an \fBchar\fR. On the Sun Type 4 keyboard, the
\fBLEDs\fR are set to the value specified in that \fBchar\fR. The values for
the four \fBLEDs\fR are:
.sp
.ne 2
.na
\fB\fBLED_CAPS_LOCK\fR \fR
.ad
.RS 20n
"Caps Lock" light.
.RE

.sp
.ne 2
.na
\fB\fBLED_COMPOSE\fR \fR
.ad
.RS 20n
"Compose" light.
.RE

.sp
.ne 2
.na
\fB\fBLED_SCROLL_LOCK\fR \fR
.ad
.RS 20n
"Scroll Lock" light.
.RE

.sp
.ne 2
.na
\fB\fBLED_NUM_LOCK\fR \fR
.ad
.RS 20n
"Num Lock" light.
.RE

On some Japanese layouts, the value for the fifth  \fBLED\fR is:
.sp
.ne 2
.na
\fB\fBLED_KANA\fR \fR
.ad
.RS 13n
"Kana" light.
.RE

.RE

.sp
.ne 2
.na
\fB\fBKIOCGLED\fR \fR
.ad
.RS 16n
Pointer to a \fBchar\fR. The current state of the \fBLEDs\fR is stored in the
\fBchar\fR pointed to by the argument.
.RE

.sp
.ne 2
.na
\fB\fBKIOCSCOMPAT\fR \fR
.ad
.RS 16n
Pointer to an \fBint\fR. "Compatibility mode" is turned on if the \fBint\fR has
a value of 1, and is turned off if the \fBint\fR has a value of 0.
.RE

.sp
.ne 2
.na
\fB\fBKIOCGCOMPAT\fR \fR
.ad
.RS 16n
Pointer to an \fBint\fR. The current state of "compatibility mode" is stored in
the \fBint\fR pointed to by the argument.
.RE

.sp
.LP
The following \fBioctl()\fR request allows the default effect of the keyboard
abort sequence to be changed.
.sp
.ne 2
.na
\fB\fBKIOCSKABORTEN\fR \fR
.ad
.RS 18n
Pointer to an \fBint\fR. The keyboard abort sequence effect (typically L1-A or
Stop-A on the keyboard on SPARC systems, F1-A on x86 systems, and BREAK on the
serial console device) is enabled if the \fBint\fR has a value of
KIOCABORTENABLE(1). If the value is KIOCABORTDISABLE(0) , the keyboard abort
sequence effect is disabled. If the value is KIOCABORTALTERNATE(2), the
Alternate Break sequence is in effect and is defined by the serial console
drivers \fBzs\fR(7D)\fBse\fR(7D) and \fBasy\fR(7D). Any other value of the
parameter for this \fBioctl()\fR is treated as \fBenable\fR. The Alternate
Break sequence is applicable to the serial console devices only.
.sp
Due to a risk of incorrect sequence interpretation, SLIP and certain other
binary protocols should not be run over the serial console port when Alternate
Break sequence is in effect. Although PPP is a binary protocol, it is able to
avoid these sequences using the ACCM feature in \fIRFC 1662\fR. For Solaris PPP
4.0, you do this by adding the following line to the \fB/etc/ppp/options\fR
file (or other configuration files used for the connection; see \fBpppd\fR(1M)
for details):
.sp
.in +2
.nf
asyncmap  0x00002000
.fi
.in -2

SLIP has no comparable capability, and must not be used if the Alternate Break
sequence is in use.
.sp
This \fBioctl()\fR will be active and retain state even if there is no physical
keyboard in the system. The default effect (\fBenable\fR) causes the operating
system to suspend and enter the kernel debugger (if present) or the system prom
(on most systems with OpenBoot proms). The default effect is enabled on most
systems, but may be different on server systems with key switches in
the 'secure' position. On these systems, the effect is always disabled when the key
switch is in the 'secure' position. This \fBioctl()\fRreturns \fBEPERM\fR if
the caller is not the superuser.
.RE

.sp
.LP
These \fBioctl()\fR requests are supported for compatibility with the system
keyboard device \fB/dev/kbd\fR.
.sp
.ne 2
.na
\fB\fBKIOCSDIRECT\fR \fR
.ad
.RS 16n
Has no effect.
.RE

.sp
.ne 2
.na
\fB\fBKIOCGDIRECT\fR \fR
.ad
.RS 16n
Always returns 1.
.RE

.sp
.LP
The following \fBioctl()\fR requests are used to set and get the keyboard
autorepeat delay and rate.
.sp
.ne 2
.na
\fB\fBKIOCSRPTDELAY\fR \fR
.ad
.RS 18n
This argument is a pointer to an int, which is the kb autorepeat delay, unit in
millisecond.
.RE

.sp
.ne 2
.na
\fB\fBKIOCGRPTDELAY\fR \fR
.ad
.RS 18n
This argument is a pointer to an int. The current auto repeat delay setting is
stored in the integer pointed by the argument, unit in millisecond.
.RE

.sp
.ne 2
.na
\fB\fBKIOCSRPTRATE\fR \fR
.ad
.RS 18n
This argument is a pointer to an int, which is the kb autorepeat rate, unit in
millisecond.
.RE

.sp
.ne 2
.na
\fB\fBKIOCGRPTRATE\fR \fR
.ad
.RS 18n
This argument is a pointer to an int. The current auto repeat rate setting is
stored in the integer pointed by the argument, unit in millisecond.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Stable
.TE

.SH SEE ALSO
.sp
.LP
\fBkbd\fR(1), \fBloadkeys\fR(1), \fBkadb\fR(1M), \fBpppd\fR(1M),
\fBkeytables\fR(4), \fBattributes\fR(5), \fBzs\fR(7D), \fBse\fR(7D),
\fBasy\fR(7D), \fBvirtualkm\fR(7D), \fBtermio\fR(7I), \fBusbkbm\fR(7M)
.SH NOTES
.sp
.LP
Many keyboards released after Sun Type 4 keyboard also report themselves  as
Sun Type 4 keyboards.