Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man7m / kb.7m
blob022ad183f0ab9761ea56d673c93633a99127a29d
1 '\" te
2 .\"  All Rights Reserved Copyright (c) 2004, Sun Microsystems, Inc.  All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH KB 7M "Feb 26, 2004"
7 .SH NAME
8 kb \- keyboard STREAMS module
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/types.h>
13 .fi
15 .LP
16 .nf
17 #include <sys/stream.h>
18 .fi
20 .LP
21 .nf
22 #include <sys/stropts.h>
23 .fi
25 .LP
26 .nf
27 #include <sys/vuid_event.h>
28 .fi
30 .LP
31 .nf
32 #include <sys/kbio.h>
33 .fi
35 .LP
36 .nf
37 #include <sys/kbd.h>
38 .fi
40 .LP
41 .nf
42 ioctl(fd, I_PUSH, "kb");
43 .fi
45 .SH DESCRIPTION
46 .sp
47 .LP
48 The \fBkb\fR STREAMS module processes byte streams generated by a keyboard
49 attached to a \fBCPU\fR serial port. Definitions for altering keyboard
50 translation and reading events from the keyboard are contained in
51 <\fBsys/kbio.h\fR> and <\fBsys/kbd.h\fR>.
52 .sp
53 .LP
54 The \fBkb\fR STREAMS module utilizes a set of keyboard tables to recognize
55 which keys have been typed. Each translation table is an array of 128 16-bit
56 words (\fBunsigned short\fRs). If a table entry is less than 0x100, the entry
57 is treated as an \fBISO\fR 8859/1 character. Higher values indicate special
58 characters that invoke more complicated actions.
59 .SS "Keyboard Translation Mode"
60 .sp
61 .LP
62 The keyboard can be in one of the following translation modes:
63 .sp
64 .ne 2
65 .na
66 \fB\fBTR_NONE\fR \fR
67 .ad
68 .RS 21n
69 Keyboard translation is turned off and up/down key codes are reported.
70 .RE
72 .sp
73 .ne 2
74 .na
75 \fB\fBTR_ASCII\fR \fR
76 .ad
77 .RS 21n
78 \fBISO\fR 8859/1 codes are reported.
79 .RE
81 .sp
82 .ne 2
83 .na
84 \fB\fBTR_EVENT\fR \fR
85 .ad
86 .RS 21n
87 \fBfirm_events\fR are reported.
88 .RE
90 .sp
91 .ne 2
92 .na
93 \fB\fBTR_UNTRANS_EVENT\fR \fR
94 .ad
95 .RS 21n
96 \fBfirm_events\fR containing unencoded keystation codes are reported for all
97 input events within the window system.
98 .RE
100 .SS "Keyboard Translation-Table Entries"
103 All instances of the \fBkb\fR module share seven translation tables that
104 convert raw keystation codes to event values. The tables are:
106 .ne 2
108 \fBUnshifted\fR
110 .RS 14n
111 Used when a key is depressed and no shifts are in effect.
115 .ne 2
117 \fBShifted\fR
119 .RS 14n
120 Used when a key is depressed and a Shift key is held down.
124 .ne 2
126 \fBCaps Lock\fR
128 .RS 14n
129 Used when a key is depressed and Caps Lock is in effect.
133 .ne 2
135 \fBAlt Graph\fR
137 .RS 14n
138 Used when a key is depressed and the Alt Graph key is held down.
142 .ne 2
144 \fBNum Lock\fR
146 .RS 14n
147 Used when a key is depressed and Num Lock is in effect.
151 .ne 2
153 \fBControlled\fR
155 .RS 14n
156 Used when a key is depressed and the Control key is held down. (Regardless of
157 whether a Shift key or the Alt Graph is being held down, or whether Caps Lock
158 or Num Lock is in effect).
162 .ne 2
164 \fBKey Up\fR
166 .RS 14n
167 Used when a key is released.
172 Each key on the keyboard has a \fBkey station\fR code that represents a number
173 from 0 to 127. The number is used as an index into the translation table that
174 is currently in effect. If the corresponding entry in the translation table is
175 a value from 0 to 255, the value is treated as an \fBISO\fR 8859/1 character,
176 and the character is the result of the translation.
179 If the entry in the translation table is higher than 255, it is a special
180 entry. Special entry values are classified according to the value of the
181 high-order bits. The high-order value for each class is defined as a constant,
182 as shown below. When added to the constant, the value of the low-order bits
183 distinguish between keys within each class:
185 .ne 2
187 \fBSHIFTKEYS 0x100 \fR
189 .RS 20n
190 A shift key. The value of the particular shift key is added to determine which
191 shift mask to apply:
193 .ne 2
195 \fB\fBCAPSLOCK 0\fR \fR
197 .RS 17n
198 Caps Lock key.
202 .ne 2
204 \fB\fBSHIFTLOCK 1\fR \fR
206 .RS 17n
207 "Shift Lock" key.
211 .ne 2
213 \fB\fBLEFTSHIFT 2\fR \fR
215 .RS 17n
216 Left-hand Shift key.
220 .ne 2
222 \fB\fBRIGHTSHIFT 3\fR \fR
224 .RS 17n
225 Right-hand Shift key.
229 .ne 2
231 \fB\fBLEFTCTRL 4\fR \fR
233 .RS 17n
234 Left-hand (or only) Control key.
238 .ne 2
240 \fB\fBRIGHTCTRL 5\fR \fR
242 .RS 17n
243 Right-hand Control key.
247 .ne 2
249 \fB\fBALTGRAPH 9\fR \fR
251 .RS 17n
252  Alt Graph key.
256 .ne 2
258 \fB\fBALT 10\fR \fR
260 .RS 17n
261  Alternate or Alt key.
265 .ne 2
267 \fB\fBNUMLOCK 11\fR \fR
269 .RS 17n
270  Num Lock key.
276 .ne 2
278 \fB\fBBUCKYBITS 0x200\fR \fR
280 .RS 20n
281 Used to toggle mode-key-up/down status without altering the value of an
282 accompanying \fBISO\fR 8859/1 character. The actual bit-position value, minus
283 7, is added.
285 .ne 2
287 \fB\fBMETABIT 0\fR \fR
289 .RS 16n
290 The Meta key was pressed along with the key. This is the only user-accessible
291 bucky bit. It is ORed in as the 0x80 bit; since this bit is a legitimate bit in
292 a character, the only way to distinguish between, for example, 0xA0 as
293 \fBMETA+0x20\fR and 0xA0 as an 8-bit character is to watch for META key up and
294 META key down events and keep track of whether the \fBMETA\fR key was down.
298 .ne 2
300 \fB\fBSYSTEMBIT 1\fR \fR
302 .RS 16n
303 The System key was pressed. This is a place holder to indicate which key is the
304 system-abort key.
310 .ne 2
312 \fB\fBFUNNY 0x300\fR \fR
314 .RS 20n
315 Performs various functions depending on the value of the low 4 bits:
317 .ne 2
319 \fB\fBNOP 0x300\fR \fR
321 .RS 20n
322 Does nothing.
326 .ne 2
328 \fB\fBOOPS 0x301\fR \fR
330 .RS 20n
331 Exists, but is undefined.
335 .ne 2
337 \fB\fBHOLE 0x302\fR \fR
339 .RS 20n
340 There is no key in this position on the keyboard, and the position-code should
341 not be used.
345 .ne 2
347 \fB\fBRESET 0x306\fR \fR
349 .RS 20n
350 Keyboard reset.
354 .ne 2
356 \fB\fBERROR 0x307\fR \fR
358 .RS 20n
359 The keyboard driver detected an internal error.
363 .ne 2
365 \fB\fBIDLE 0x308\fR \fR
367 .RS 20n
368 The keyboard is idle (no keys down).
372 .ne 2
374 \fB\fBCOMPOSE 0x309\fR \fR
376 .RS 20n
377 The \fBCOMPOSE\fR key; the next two keys should comprise a two-character
378 COMPOSE key sequence.
382 .ne 2
384 \fB\fBNONL 0x30A\fR \fR
386 .RS 20n
387 Used only in the Num Lock table; indicates that this key is not affected by the
388 Num Lock state, so that the translation table to use to translate this key
389 should be the one that would have been used had Num Lock not been in effect.
393 .ne 2
395 \fB0x30B \(em 0x30F\fR
397 .RS 20n
398 Reserved for non-parameterized functions.
404 .ne 2
406 \fB\fBFA_CLASS 0x400\fR \fR
408 .RS 20n
409 A floating accent or "dead key." When this key is pressed, the next key
410 generates an event for an accented character; for example, "floating accent
411 grave" followed by the "a" key generates an event with the \fBISO\fR 8859/1
412 code for the "a with grave accent" character. The low-order bits indicate which
413 accent; the codes for the individual "floating accents" are as follows:
415 .ne 2
417 \fB\fBFA_UMLAUT 0x400\fR \fR
419 .RS 21n
420 umlaut
424 .ne 2
426 \fB\fBFA_CFLEX 0x401\fR \fR
428 .RS 21n
429 circumflex
433 .ne 2
435 \fB\fBFA_TILDE 0x402\fR \fR
437 .RS 21n
438 tilde
442 .ne 2
444 \fB\fBFA_CEDILLA 0x403\fR \fR
446 .RS 21n
447 cedilla
451 .ne 2
453 \fB\fBFA_ACUTE 0x404\fR \fR
455 .RS 21n
456 acute accent
460 .ne 2
462 \fB\fBFA_GRAVE 0x405\fR \fR
464 .RS 21n
465 grave accent
471 .ne 2
473 \fB\fBSTRING 0x500\fR \fR
475 .RS 20n
476 The low-order bits index a table of strings. When a key with a \fBSTRING\fR
477 entry is depressed, the characters in the null-terminated string for that key
478 are sent, character-by-character. The maximum length is defined as:
480 .ne 2
482 \fBKTAB_STRLEN \fR
484 .RS 16n
488 Individual string numbers are defined as:
490 .ne 2
492 \fBHOMEARROW \fR
494 .RS 15n
495 0x00
499 .ne 2
501 \fB\fBUPARROW\fR \fR
503 .RS 15n
504 0x01
508 .ne 2
510 \fB\fBDOWNARROW\fR \fR
512 .RS 15n
513 0x02
517 .ne 2
519 \fB\fBLEFTARROW\fR \fR
521 .RS 15n
522 0x03
526 .ne 2
528 \fB\fBRIGHTARROW\fR \fR
530 .RS 15n
531 0x04
534 String numbers 0x05 \(em 0x0F are available for custom entries.
538 .ne 2
540 \fB\fBFUNCKEYS 0x600\fR \fR
542 .RS 20n
543 There are 64 keys reserved for function keys. The actual positions are usually
544 on the left/right/top/bottom of the keyboard.
546 The next-to-lowest 4 bits indicate the group of function keys:
548 .ne 2
550 \fB\fBLEFTFUNC \fR \fR
552 .RS 18n
553 0x600
557 .ne 2
559 \fB\fBRIGHTFUNC \fR \fR
561 .RS 18n
562 0x610
566 .ne 2
568 \fB\fBTOPFUNC 0x610\fR \fR
570 .RS 18n
571 0x610
575 .ne 2
577 \fB\fBBOTTOMFUNC \fR \fR
579 .RS 18n
580 0x630
583 The low 4 bits indicate the function key number within the group:
585 .ne 2
587 \fBLF(\fIn\fR)\fR
589 .RS 10n
590 (LEFTFUNC+(\fIn\fR)-1)
594 .ne 2
596 \fBRF(\fIn\fR) \fR
598 .RS 10n
599 (RIGHTFUNC+(\fIn\fR)-1)
603 .ne 2
605 \fBTF(\fIn\fR) \fR
607 .RS 10n
608 (TOPFUNC+(\fIn\fR)-1)
612 .ne 2
614 \fBBF(\fIn\fR) \fR
616 .RS 10n
617 (BOTTOMFUNC+(\fIn\fR)-1)
623 .ne 2
625 \fB\fBPADKEYS 0x700\fR \fR
627 .RS 18n
628 A "numeric keypad key." These entries should appear only in the Num Lock
629 translation table; when Num Lock is in effect, these events will be generated
630 by pressing keys on the right-hand keypad. The low-order bits indicate which
631 key. The codes for the individual keys are:
633 .ne 2
635 \fB\fBPADEQUAL 0x700\fR \fR
637 .RS 19n
638 "=" key
642 .ne 2
644 \fB\fBPADSLASH 0x701\fR \fR
646 .RS 19n
647 "/" key
651 .ne 2
653 \fB\fBPADSTAR 0x702\fR \fR
655 .RS 19n
656 "*" key
660 .ne 2
662 \fB\fBPADMINUS 0x703\fR \fR
664 .RS 19n
665 "-" key
669 .ne 2
671 \fB\fBPADSEP 0x704\fR \fR
673 .RS 19n
674 "," key
678 .ne 2
680 \fB\fBPAD7 0x705\fR \fR
682 .RS 19n
683 "7" key
687 .ne 2
689 \fB\fBPAD8 0x706\fR \fR
691 .RS 19n
692 "8" key
696 .ne 2
698 \fB\fBPAD9 0x707\fR \fR
700 .RS 19n
701 "9" key
705 .ne 2
707 \fB\fBPADPLUS 0x708\fR \fR
709 .RS 19n
710 "+" key
714 .ne 2
716 \fB\fBPAD4 0x709\fR \fR
718 .RS 19n
719 "4" key
723 .ne 2
725 \fB\fBPAD5 0x70A\fR \fR
727 .RS 19n
728 "5" key
732 .ne 2
734 \fB\fBPAD6 0x70B\fR \fR
736 .RS 19n
737 "6" key
741 .ne 2
743 \fB\fBPAD1 0x70C\fR \fR
745 .RS 19n
746 "1" key
750 .ne 2
752 \fB\fBPAD2 0x70D\fR \fR
754 .RS 19n
755 "2" key
759 .ne 2
761 \fB\fBPAD3 0x70E\fR \fR
763 .RS 19n
764 "3" key
768 .ne 2
770 \fB\fBPAD0 0x70F\fR \fR
772 .RS 19n
773 "0" key
777 .ne 2
779 \fB\fBPADDOT 0x710\fR \fR
781 .RS 19n
782 "." key
786 .ne 2
788 \fB\fBPADENTER 0x711\fR \fR
790 .RS 19n
791 "Enter" key
798 When a function key is pressed in \fBTR_ASCII\fR mode, the following escape
799 sequence is sent:
802 \fBESC[0\|.\|.\|..\|9z\fR
805 where  \fBESC\fR is a single escape character and "0\|.\|..\|9" indicates the
806 decimal representation of the function-key value. For example, function key
807 \fBR1\fR sends the sequence:
810 \fBESC[208z\fR
813 because the decimal value of RF(1) is 208. In \fBTR_EVENT\fR mode, if there is
814 a \fBVUID\fR event code for the function key in question, an event with that
815 event code is generated; otherwise, individual events for the characters of the
816 escape sequence are generated.
817 .SS "Keyboard Compatibility Mode"
820 When started, the \fBkb\fR STREAMS module is in the compatibility mode. When
821 the keyboard is in the \fBTR_EVENT\fR translation mode, \fBISO\fR 8859/1
822 characters from the upper half of the character set (that is, characters with
823 the eighth bit set) , are presented as events with codes in the \fBISO_FIRST\fR
824 range (as defined in <\fB<sys/vuid_event.h>\fR>). For backwards compatibility
825 with older versions of the keyboard driver, the event code is \fBISO_FIRST\fR
826 plus the character value. When compatibility mode is turned off, \fBISO\fR
827 8859/1 characters are presented as events with codes equal to the character
828 code.
829 .SH DESCRIPTION
832 The following \fBioctl()\fR requests set and retrieve the current translation
833 mode of a keyboard:
835 .ne 2
837 \fB\fBKIOCTRANS\fR \fR
839 .RS 15n
840 Pointer to an \fBint\fR. The translation mode is set to the value in the
841 \fBint\fR pointed to by the argument.
845 .ne 2
847 \fB\fBKIOCGTRANS\fR \fR
849 .RS 15n
850 Pointer to an \fBint\fR. The current translation mode is stored in the
851 \fBint\fR pointed to by the argument.
856 \fBioctl()\fR requests for changing and retrieving entries from the keyboard
857 translation table use the \fBkiockeymap\fR structure:
859 .in +2
861 struct kiockeymap {
862 int     kio_tablemask;  /* Translation table (one of: 0, CAPSMASK,
863                          * SHIFTMASK, CTRLMASK, UPMASK,
864                          * ALTGRAPHMASK, NUMLOCKMASK)
865                          */
866 #define KIOCABORT1 -1     /* Special "mask": abort1 keystation */
867 #define KIOCABORT2 -2     /* Special "mask": abort2 keystation */
868         uchar_t kio_station; /* Physical keyboard key station (0-127) */
869         ushort_t kio_entry;        /* Translation table station's entry */
870         char kio_string[10]; /* Value for STRING entries-null terminated */
873 .in -2
876 .ne 2
878 \fB\fBKIOCSKEY\fR \fR
880 .RS 13n
881 Pointer to a \fBkiockeymap\fR structure. The translation table entry referred
882 to by the values in that structure is changed. The \fBkio_tablemask\fR request
883 specifies which of the following translation tables contains the entry to be
884 modified:
886 .ne 2
888 \fB\fBUPMASK 0x0080\fR \fR
890 .sp .6
891 .RS 4n
892 "Key Up" translation table.
896 .ne 2
898 \fB\fBNUMLOCKMASK 0x0800\fR \fR
900 .sp .6
901 .RS 4n
902 "Num Lock" translation table.
906 .ne 2
908 \fB\fBCTRLMASK 0x0030\fR \fR
910 .sp .6
911 .RS 4n
912 "Controlled" translation table.
916 .ne 2
918 \fB\fBALTGRAPHMASK 0x0200\fR \fR
920 .sp .6
921 .RS 4n
922 "Alt Graph" translation table.
926 .ne 2
928 \fB\fBSHIFTMASK 0x000E\fR \fR
930 .sp .6
931 .RS 4n
932 "Shifted" translation table.
936 .ne 2
938 \fB\fBCAPSMASK 0x0001\fR \fR
940 .sp .6
941 .RS 4n
942 "Caps Lock" translation table.
946 .ne 2
948 \fB(No shift keys pressed or locked)\fR
950 .sp .6
951 .RS 4n
952 "Unshifted" translation table.
959 The \fBkio_station\fR request specifies the keystation code for the entry to be
960 modified. The value of \fBkio_entry\fR is stored in the entry in question. If
961 \fBkio_entry\fR is between \fBSTRING\fR and \fBSTRING+15,\fR the string
962 contained in \fBkio_string\fR is copied to the appropriate string table entry.
963 This call may return \fBEINVAL\fR if there are invalid arguments.
966 Special values of \fBkio_tablemask\fR can affect the two step "break to the
967 \fBPROM\fR monitor" sequence. The usual sequence is \fBL1\fR-\fBa\fR or
968 \fBStop\fR-. If \fBkio_tablemask\fR is \fBKIOCABORT1\fR, then the value of
969 \fBkio_station\fR is set to be the first keystation in the sequence. If
970 \fBkio_tablemask\fR, is \fBKIOCABORT2\fR then the value of \fBkio_station\fR is
971 set to be the second keystation in the sequence. An attempt to change the
972 "break to the  \fBPROM\fR monitor" sequence without having superuser permission
973 results in an  \fBEPERM\fR error.
975 .ne 2
977 \fB\fBKIOCGKEY\fR \fR
979 .RS 13n
980 The argument is a pointer to a \fBkiockeymap\fR structure. The current value of
981 the keyboard translation table entry specified by \fBkio_tablemask\fR and
982 \fBkio_station\fR is stored in the structure pointed to by the argument. This
983 call may return \fBEINVAL\fR if there are invalid arguments.
987 .ne 2
989 \fB\fBKIOCTYPE\fR \fR
991 .RS 13n
992 The argument is a pointer to an \fBint\fR. A code indicating the type of the
993 keyboard is stored in the \fBint\fR pointed to by the argument:
995 .ne 2
997 \fB\fBKB_SUN3\fR \fR
999 .RS 14n
1000 Sun Type 3 keyboard
1004 .ne 2
1006 \fB\fBKB_SUN4\fR \fR
1008 .RS 14n
1009 Sun Type 4 or 5 keyboard, or non-USB Sun Type 6 keyboard
1013 .ne 2
1015 \fB\fBKB_USB\fR \fR
1017 .RS 14n
1018 USB standard HID keyboard, including Sun Type 6 USB keyboards
1022 .ne 2
1024 \fB\fBKB_ASCII\fR \fR
1026 .RS 14n
1027 ASCII terminal masquerading as keyboard
1031 .ne 2
1033 \fB\fBKB_PC\fR \fR
1035 .RS 14n
1036 Type 101 PC keyboard
1040 .ne 2
1042 \fB\fBKB_DEFAULT\fR\fR
1044 .RS 14n
1045  Stored in the \fBint\fR pointed to by the argument if the keyboard type is
1046 unknown. In case of error, -1 is stored in the \fBint\fR pointed to by the
1047 argument.
1053 .ne 2
1055 \fB\fBKIOCLAYOUT\fR \fR
1057 .RS 15n
1058 The argument is a pointer to an \fBint\fR. On a Sun Type 4 keyboard, the layout
1059 code specified by the keyboard's \fBDIP\fR switches is stored in the \fBint\fR
1060 pointed to by the argument.
1064 .ne 2
1066 \fB\fBKIOCCMD\fR \fR
1068 .RS 15n
1069 The argument is a pointer to an \fBint\fR. The command specified by the value
1070 of the \fBint\fR pointed to by the argument is sent to the keyboard. The
1071 commands that can be sent are:
1073 Commands to the Sun Type 3 and Sun Type 4 keyboards:
1075 .ne 2
1077 \fB\fBKBD_CMD_RESET\fR \fR
1079 .RS 20n
1080 Reset keyboard as if power-up.
1084 .ne 2
1086 \fB\fBKBD_CMD_BELL\fR \fR
1088 .RS 20n
1089 Turn on the bell.
1093 .ne 2
1095 \fB\fBKBD_CMD_NOBELL\fR \fR
1097 .RS 20n
1098 Turn off the bell.
1102 .ne 2
1104 \fB\fBKBD_CMD_CLICK\fR \fR
1106 .RS 20n
1107 Turn on the click annunciator.
1111 .ne 2
1113 \fB\fBKBD_CMD_NOCLICK\fR \fR
1115 .RS 20n
1116 Turn off the click annunciator.
1119 Commands to the Sun Type 4 keyboard:
1121 .ne 2
1123 \fB\fBKBD_CMD_SETLED\fR \fR
1125 .RS 22n
1126 Set keyboard LEDs.
1130 .ne 2
1132 \fB\fBKBD_CMD_GETLAYOUT\fR \fR
1134 .RS 22n
1135 Request that keyboard indicate layout.
1142 Inappropriate commands for particular keyboard types are ignored. Since there
1143 is no reliable way to get the state of the bell or click (because the keyboard
1144 cannot be queried and a process could do writes to the appropriate serial
1145 driver \(em circumventing this \fBioctl()\fR request) an equivalent
1146 \fBioctl()\fR to query its state is not provided.
1148 .ne 2
1150 \fB\fBKIOCSLED\fR \fR
1152 .RS 13n
1153 The argument is a pointer to an \fBchar\fR. On the Sun Type 4 keyboard, the
1154 \fBLEDs\fR are set to the value specified in that \fBchar\fR. The values for
1155 the four \fBLEDs\fR are:
1157 .ne 2
1159 \fB\fBLED_CAPS_LOCK\fR \fR
1161 .RS 20n
1162 "Caps Lock" light.
1166 .ne 2
1168 \fB\fBLED_COMPOSE\fR \fR
1170 .RS 20n
1171 "Compose" light.
1175 .ne 2
1177 \fB\fBLED_SCROLL_LOCK\fR \fR
1179 .RS 20n
1180 "Scroll Lock" light.
1184 .ne 2
1186 \fB\fBLED_NUM_LOCK\fR \fR
1188 .RS 20n
1189 "Num Lock" light.
1192 On some Japanese layouts, the value for the fifth  \fBLED\fR is:
1194 .ne 2
1196 \fB\fBLED_KANA\fR \fR
1198 .RS 13n
1199 "Kana" light.
1205 .ne 2
1207 \fB\fBKIOCGLED\fR \fR
1209 .RS 16n
1210 Pointer to a \fBchar\fR. The current state of the \fBLEDs\fR is stored in the
1211 \fBchar\fR pointed to by the argument.
1215 .ne 2
1217 \fB\fBKIOCSCOMPAT\fR \fR
1219 .RS 16n
1220 Pointer to an \fBint\fR. "Compatibility mode" is turned on if the \fBint\fR has
1221 a value of 1, and is turned off if the \fBint\fR has a value of 0.
1225 .ne 2
1227 \fB\fBKIOCGCOMPAT\fR \fR
1229 .RS 16n
1230 Pointer to an \fBint\fR. The current state of "compatibility mode" is stored in
1231 the \fBint\fR pointed to by the argument.
1236 The following \fBioctl()\fR request allows the default effect of the keyboard
1237 abort sequence to be changed.
1239 .ne 2
1241 \fB\fBKIOCSKABORTEN\fR \fR
1243 .RS 18n
1244 Pointer to an \fBint\fR. The keyboard abort sequence effect (typically L1-A or
1245 Stop-A on the keyboard on SPARC systems, F1-A on x86 systems, and BREAK on the
1246 serial console device) is enabled if the \fBint\fR has a value of
1247 KIOCABORTENABLE(1). If the value is KIOCABORTDISABLE(0) , the keyboard abort
1248 sequence effect is disabled. If the value is KIOCABORTALTERNATE(2), the
1249 Alternate Break sequence is in effect and is defined by the serial console
1250 drivers \fBzs\fR(7D)\fBse\fR(7D) and \fBasy\fR(7D). Any other value of the
1251 parameter for this \fBioctl()\fR is treated as \fBenable\fR. The Alternate
1252 Break sequence is applicable to the serial console devices only.
1254 Due to a risk of incorrect sequence interpretation, SLIP and certain other
1255 binary protocols should not be run over the serial console port when Alternate
1256 Break sequence is in effect. Although PPP is a binary protocol, it is able to
1257 avoid these sequences using the ACCM feature in \fIRFC 1662\fR. For Solaris PPP
1258 4.0, you do this by adding the following line to the \fB/etc/ppp/options\fR
1259 file (or other configuration files used for the connection; see \fBpppd\fR(8)
1260 for details):
1262 .in +2
1264 asyncmap  0x00002000
1266 .in -2
1268 SLIP has no comparable capability, and must not be used if the Alternate Break
1269 sequence is in use.
1271 This \fBioctl()\fR will be active and retain state even if there is no physical
1272 keyboard in the system. The default effect (\fBenable\fR) causes the operating
1273 system to suspend and enter the kernel debugger (if present) or the system prom
1274 (on most systems with OpenBoot proms). The default effect is enabled on most
1275 systems, but may be different on server systems with key switches in
1276 the 'secure' position. On these systems, the effect is always disabled when the key
1277 switch is in the 'secure' position. This \fBioctl()\fRreturns \fBEPERM\fR if
1278 the caller is not the superuser.
1283 These \fBioctl()\fR requests are supported for compatibility with the system
1284 keyboard device \fB/dev/kbd\fR.
1286 .ne 2
1288 \fB\fBKIOCSDIRECT\fR \fR
1290 .RS 16n
1291 Has no effect.
1295 .ne 2
1297 \fB\fBKIOCGDIRECT\fR \fR
1299 .RS 16n
1300 Always returns 1.
1305 The following \fBioctl()\fR requests are used to set and get the keyboard
1306 autorepeat delay and rate.
1308 .ne 2
1310 \fB\fBKIOCSRPTDELAY\fR \fR
1312 .RS 18n
1313 This argument is a pointer to an int, which is the kb autorepeat delay, unit in
1314 millisecond.
1318 .ne 2
1320 \fB\fBKIOCGRPTDELAY\fR \fR
1322 .RS 18n
1323 This argument is a pointer to an int. The current auto repeat delay setting is
1324 stored in the integer pointed by the argument, unit in millisecond.
1328 .ne 2
1330 \fB\fBKIOCSRPTRATE\fR \fR
1332 .RS 18n
1333 This argument is a pointer to an int, which is the kb autorepeat rate, unit in
1334 millisecond.
1338 .ne 2
1340 \fB\fBKIOCGRPTRATE\fR \fR
1342 .RS 18n
1343 This argument is a pointer to an int. The current auto repeat rate setting is
1344 stored in the integer pointed by the argument, unit in millisecond.
1347 .SH ATTRIBUTES
1350 See \fBattributes\fR(5) for descriptions of the following attributes:
1355 box;
1356 c | c
1357 l | l .
1358 ATTRIBUTE TYPE  ATTRIBUTE VALUE
1360 Interface Stability     Stable
1363 .SH SEE ALSO
1366 \fBkbd\fR(1), \fBloadkeys\fR(1), \fBkadb\fR(8), \fBpppd\fR(8),
1367 \fBkeytables\fR(4), \fBattributes\fR(5), \fBzs\fR(7D), \fBse\fR(7D),
1368 \fBasy\fR(7D), \fBvirtualkm\fR(7D), \fBtermio\fR(7I), \fBusbkbm\fR(7M)
1369 .SH NOTES
1372 Many keyboards released after Sun Type 4 keyboard also report themselves  as
1373 Sun Type 4 keyboards.