Merge commit 'b31ca922c7346747131aed07c0c171ec2f573aac' into merges
[unleashed.git] / share / man / man1 / kbd.1
blob1e4747ddb6e682d8aa98df89722e609a659b95d3
1 '\" te
2 .\" Copyright (c) 2007, 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 KBD 1 "Jan 29, 2007"
7 .SH NAME
8 kbd \- manipulate the state of keyboard, or display the type of keyboard, or
9 change the default keyboard abort sequence effect
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBkbd\fR [\fB-r\fR] [\fB-t\fR ] [\fB-l\fR] [\fB-a\fR enable | disable | alternate]
14      [\fB-c\fR on | off] [\fB-d\fR \fIkeyboard device\fR]
15      [\fB-D\fR \fIautorepeat delay\fR] [\fB-R\fR \fIautorepeat rate\fR]
16 .fi
18 .LP
19 .nf
20 \fBkbd\fR [\fB-i\fR] [\fB-d\fR \fIkeyboard device\fR]
21 .fi
23 .LP
24 .nf
25 \fBkbd\fR \fB-s\fR [\fIlanguage\fR]
26 .fi
28 .LP
29 .nf
30 \fBkbd\fR \fB-b\fR [\fBkeyboard\fR | \fBconsole\fR] \fIfrequency\fR
31 .fi
33 .SH DESCRIPTION
34 .sp
35 .LP
36 The \fBkbd\fR utility manipulates the state of the keyboard, or displays the
37 keyboard type, or allows the default keyboard abort sequence effect to be
38 changed. The abort sequence also applies to serial console devices. The
39 \fBkbd\fR utility sets the \fB/dev/kbd\fR default keyboard device.
40 .SH EXTENDED DESCRIPTION
41 .sp
42 .LP
43 The \fB-i\fR option reads and processes default values for the keyclick and
44 keyboard abort settings from the \fB/etc/default/kbd\fR keyboard default file.
45 Only keyboards that support a clicker respond to the \fB-c\fR option. To turn
46 clicking on by default, add or change the value of the \fBKEYCLICK\fR variable
47 in the \fB/etc/default/kbd\fR file to:
48 .sp
49 .in +2
50 .nf
51 KEYCLICK=on
52 .fi
53 .in -2
54 .sp
56 .sp
57 .LP
58 Next, run the command \fBkbd\fR \fB-i\fR to change the setting. Valid settings
59 for the \fBKEYCLICK\fR variable are \fBon\fR and \fBoff\fR; all other values
60 are ignored. If the \fBKEYCLICK\fR variable is not specified in the default
61 file, the setting is unchanged.
62 .sp
63 .LP
64 The keyboard abort sequence effect can only be changed by a super-user using
65 the \fB-a\fR option. This sequence is typically Stop-A or L1-A and Shift-Pause
66 on the keyboard on \fBSPARC\fR systems, F1-A and Shift-Pause on x86 systems,
67 and BREAK on the serial console input device on most systems.
68 .sp
69 .LP
70 A \fBBREAK\fR condition that originates from an erroneous electrical signal
71 cannot be distinguished from one deliberately sent by remote \fBDCE\fR. As a
72 remedy, use the \fB-a\fR option with Alternate Break to switch break
73 interpretation. Due to the risk of incorrect sequence interpretation, binary
74 protocols such as \fBSLIP\fR and others should not be run over the serial
75 console port when Alternate Break sequence is in effect.
76 .sp
77 .LP
78 Although PPP is a binary protocol, it has the ability to avoid using characters
79 that interfere with serial operation. The default alternate break sequence is
80 CTRL-m \fB~\fR CTRL-b, or \fB0D 7E 02\fR in hexidecimal. In PPP, this can be
81 avoided by setting either \fB0x00000004\fR or \fB0x00002000\fR in the ACCM.
82 This forces an escape for the CTRL-b or CTRL-m characters, respectively.
83 .sp
84 .LP
85 To do this in Solaris PPP 4.0, add:
86 .sp
87 .in +2
88 .nf
89 asyncmap 0x00002000
90 .fi
91 .in -2
92 .sp
94 .sp
95 .LP
96 to the \fB/etc/ppp/options\fR file or any of the other configuration files used
97 for the connection. See \fBpppd\fR(8).
98 .sp
99 .LP
100 SLIP has no comparable capability, and must not be used if the Alternate Break
101 sequence is in use.
104 The Alternate Break sequence has no effect on the keyboard abort. For more
105 information on the Alternate Break sequence, see \fBzs\fR(7D), \fBse\fR(7D),
106 and \fBasy\fR(7D).
109 On many systems, the default effect of the keyboard abort sequence is to
110 suspend the operating system and enter the debugger or the monitor. Some
111 systems feature key switches with a \fBsecure\fR position. On these systems,
112 setting the key switch to the \fBsecure\fR position overrides any software
113 default set with this command.
116 To permanently change the software default effect of the keyboard abort
117 sequence, first add or change the value of the \fBKEYBOARD_ABORT\fR variable in
118 the \fB/etc/default/kbd\fR file to:
120 .in +2
122 KEYBOARD_ABORT=disable
124 .in -2
129 Next, run the command \fBkbd\fR \fB-i\fR to change the setting. Valid settings
130 are \fBenable\fR, \fBdisable\fR, and \fBalternate\fR; all other values are
131 ignored. If the variable is not specified in the default file, the setting is
132 unchanged.
135 To set the abort sequence to the hardware BREAK, set the value of the
136 \fBKEYBOARD_ABORT\fR variable in the \fB/etc/default/kbd\fR file to:
138 .in +2
140 KEYBOARD_ABORT=enable
142 .in -2
147 To change the current setting, run the command \fBkbd\fR \fB-i\fR. To set the
148 abort sequence to the Alternate Break character sequence, first set the current
149 value of the \fBKEYBOARD_ABORT\fR variable in the \fB/etc/default/kbd\fR file
152 .in +2
154 KEYBOARD_ABORT=alternate
156 .in -2
161 Next, run the command \fBkbd\fR \fB-i\fR to change the setting. When the
162 Alternate Break sequence is in effect, only serial console devices are
163 affected.
166 To set the autorepeat delay by default, set the \fBREPEAT_DELAY\fR variable in
167 the file \fB/etc/default/kbd\fR to the expected value with units in
168 milliseconds (ms). To avoid making the keyboard unusable due to a typographical
169 error, delay values below \fBKIOCRPTDELAY_MIN\fR (defined in
170 \fB/usr/include/sys/kbio.h\fR) are rejected with \fBEINVAL\fR:
172 .in +2
174 REPEAT_DELAY=500
176 .in -2
181 To set the autorepeat rate by default, set the \fBREPEAT_RATE\fR variable in
182 the file \fB/etc/default/kbd\fR to the expected value with units in
183 milliseconds. Negative and zero repeat rates are ejected with \fBEINVAL\fR:
185 .in +2
187 REPEAT_RATE=33
189 .in -2
194 To change the current settings of \fIdelay\fR and \fIrate\fR, run the command,
195 \fBkbd\fR \fB-i\fR. When the Auto Repeat Delay and/or Auto Repeat Rate are in
196 effect, only command line mode is affected.
199 To set the language by default, set the \fBLAYOUT\fR variable in the file
200 \fB/etc/default/kbd\fR to the expected language. These languages supported in
201 kernel can be found by running \fBkbd\fR \fB-s\fR. Other values are ignored.
202 For example, the following sets Spanish layout to the keyboard:
204 .in +2
206 LAYOUT=Spanish
208 .in -2
213 Next, run the \fBkbd\fR \fB-i\fR to change the setting. When Solaris reboots,
214 the Spanish key table is loaded into kernel. These layouts are valid for
215 \fBusb\fR and \fBps/2\fR keyboards.
218 To set the keyboard beeper frequency by default, set the \fBKBD_BEEPER_FREQ\fR
219 variable in the file \fB/etc/default/kbd\fR to the expected value with units in
220 HZ. This value should be between 0 and 32767, inclusive. Otherwise will be
221 rejected with \fBEINVAL\fR:
223 .in +2
225 KBD_BEEPER_FREQ=2000
227 .in -2
232 To set the console beeper frequency by default, set the
233 \fBCONSOLE_BEEPER_FREQ\fR variable in the file \fB/etc/default/kbd\fR to the
234 expected value with units in HZ. This value should be between 0 and 32767,
235 inclusive. Otherwise will be rejected with \fBEINVAL\fR:
237 .in +2
239 CONSOLE_BEEPER_FREQ=900
241 .in -2
246 To change the current settings of keyboard beeper frequency and console beeper
247 frequency, run \fBkbd\fR \fB-i\fR.
248 .SH OPTIONS
251 The following options are supported:
253 .ne 2
255 \fB\fB-a\fR \fBenable\fR | \fBdisable\fR | \fBalternate\fR\fR
257 .sp .6
258 .RS 4n
259 Enables, disables, or alternates the keyboard abort sequence effect. By
260 default, a keyboard abort sequence suspends the operating system on most
261 systems. This sequence is typically Stop-A or L1-A and Shift-Pause on the
262 keyboard on \fBSPARC\fR systems, F1-A and Shift-Pause on x86 systems, and BREAK
263 on the serial console device.
265 The default keyboard behavior can be changed using this option. The \fB-a\fR
266 option can only be used by a super-user.
268 .ne 2
270 \fB\fBenable\fR\fR
272 .RS 13n
273 Enables the default effect of the keyboard abort sequence (suspend the
274 operating system and enter the debugger or the monitor).
278 .ne 2
280 \fB\fBdisable\fR\fR
282 .RS 13n
283 Disables the default/alternate effect and ignores keyboard abort sequences.
287 .ne 2
289 \fB\fBalternate\fR\fR
291 .RS 13n
292 Enables the alternate effect of the keyboard abort sequences (suspend the
293 operating system and enter the debugger or the monitor) upon receiving the
294 Alternate Break character sequence on the console. The Alternate Break sequence
295 is defined by the drivers \fBzs\fR(7D), \fBse\fR(7D), \fBasy\fR(7D). Due to a
296 risk of incorrect sequence interpretation, binary protocols cannot be run over
297 the serial console port when this value is used.
303 .ne 2
305 \fB\fB-b\fR \fBkeyboard\fR | \fBconsole\fR\fR
307 .sp .6
308 .RS 4n
309 Sets the beeper frequency for keyboard or console.
311 .ne 2
313 \fB\fBkeyboard\fR\fR
315 .RS 12n
316 Set the keyboard beeper frequency to the operand in HZ. See \fBOPERANDS\fR.
320 .ne 2
322 \fB\fBconsole\fR\fR
324 .RS 12n
325 Sets the console beeper frequency to the operand in HZ. See \fBOPERANDS\fR.
331 .ne 2
333 \fB\fB-c\fR \fBon\fR | \fBoff\fR\fR
335 .sp .6
336 .RS 4n
337 Turns the clicking of the keyboard on or off.
339 .ne 2
341 \fB\fBon\fR\fR
343 .RS 7n
344 Enables clicking
348 .ne 2
350 \fB\fBoff\fR\fR
352 .RS 7n
353 Disables clicking
359 .ne 2
361 \fB\fB-d\fR \fIkeyboard device\fR\fR
363 .sp .6
364 .RS 4n
365 Specifies the keyboard device being set. The default setting is \fB/dev/kbd\fR.
369 .ne 2
371 \fB\fB-D\fR \fIautorepeat delay\fR\fR
373 .sp .6
374 .RS 4n
375 Sets the autorepeat delay in milliseconds.
379 .ne 2
381 \fB\fB-i\fR\fR
383 .sp .6
384 .RS 4n
385 Sets keyboard properties from the keyboard default file. With the exception of
386 \fB-d\fR \fIkeyboard device\fR, this option cannot be used with any other
387 option. The \fB-i\fR option instructs the keyboard command to read and process
388 keyclick and keyboard abort default values from the \fB/etc/default/kbd\fR
389 file. The \fB-i\fR option can only be used by a user or role with the Device
390 Security Rights Profile.
394 .ne 2
396 \fB\fB-l\fR\fR
398 .sp .6
399 .RS 4n
400 Returns the layout code of the keyboard being used, and the autorepeat delay
401 and autorepeat rate being used.
403 If used with -R or -D option, this option returns the value before the changes.
407 .ne 2
409 \fB\fB-r\fR\fR
411 .sp .6
412 .RS 4n
413 Resets the keyboard as if power-up.
417 .ne 2
419 \fB\fB-R\fR \fIautorepeat rate\fR\fR
421 .sp .6
422 .RS 4n
423 Sets the autorepeat rate in milliseconds.
427 .ne 2
429 \fB\fB\fR\fB-s\fR \fB[\fR\fIlanguage\fR\fB]\fR\fR
431 .sp .6
432 .RS 4n
433 Sets the keyboard layout into kernel.
435 If \fIlanguage\fR is specified, the layout is set to \fIlanguage\fR. If
436 \fIlanguage\fR is not specified, a list of available layouts are presented,
437 prompting for the user to specify the \fIlanguage\fR. See \fBOPERANDS\fR.
441 .ne 2
443 \fB\fB-t\fR\fR
445 .sp .6
446 .RS 4n
447 Returns the type of the keyboard being used.
450 .SH OPERANDS
453 The following operands are supported:
455 .ne 2
457 \fBfrequency\fR
459 .RS 13n
460 The frequency value specified to be set in kernel. The receiver of this value
461 is specified by the \fB-b\fR option. This value should be between 0 and 32767
462 otherwise will be ejected with \fBEINVAL\fR.
466 .ne 2
468 \fBlanguage\fR
470 .RS 13n
471 The language specified to be set in kernel. If the language is not found, the
472 languages supported are listed for selection. It only applies to \fB-s\fR
473 option.
476 .SH EXAMPLES
478 \fBExample 1 \fRDisplaying the Keyboard Type
481 The following example displays the keyboard type:
484 .in +2
486 example% kbd -t
487 Type 4 Sun keyboard
488 example%
490 .in -2
494 \fBExample 2 \fRSetting Keyboard Defaults
497 The following example sets the keyboard defaults as specified in the keyboard
498 default file:
501 .in +2
503 example# kbd -i
504 example#
506 .in -2
510 \fBExample 3 \fRDisplaying Information
513 The following example displays keyboard type and layout code. It also displays
514 auto repeat delay and rate settings.
517 .in +2
519 example% kbd -l
520 type=4
521 layout=43 (0x2b)
522 delay(ms)=500
523 rate(ms)=33
524 example%
526 .in -2
530 \fBExample 4 \fRSetting Keyboard Autorepeat Delay
533 The following example sets the keyboard autorepeat delay:
536 .in +2
538 example% kbd -D 300
539 example%
541 .in -2
545 \fBExample 5 \fRSetting Keyboard Autorepeat Rate
548 The following example sets the keyboard autorepeat rate:
551 .in +2
553 example% kbd -R 50
554 example%
556 .in -2
560 \fBExample 6 \fRSelecting and Setting the Keyboard Language
563 The following example selects and sets the keyboard language from a list of
564 languages specified:
567 .in +2
569 example% kbd -s
570 1. Albanian                      16. Malta_UK
571 2. Belarusian                    17. Malta_US
572 3. Belgian                       18. Norwegian
573 4. Bulgarian                     19. Portuguese
574 5. Croatian                      20. Russian
575 6. Danish                        21. Serbia-And-Montenegro
576 7. Dutch                         22. Slove
577 \&......
579 To select the keyboard layout, enter a number [default n]:
581 example%
583 .in -2
588 The following example sets the keyboard language specified:
591 .in +2
593 example% kbd -s Dutch
594 example%
596 .in -2
600 \fBExample 7 \fRSetting the Keyboard Beeper Frequency
603 The following example sets the keyboard beeper frequency:
606 .in +2
608 example% kbd -b keyboard 1000
609 example%
611 .in -2
614 .SH FILES
616 .ne 2
618 \fB\fB/dev/kbd\fR\fR
620 .RS 20n
621 Keyboard device file.
625 .ne 2
627 \fB\fB/etc/default/kbd\fR\fR
629 .RS 20n
630 Keyboard default file containing software defaults for keyboard configurations.
633 .SH SEE ALSO
636 \fBloadkeys\fR(1), \fBsvcs\fR(1), \fBinetd\fR(8), \fBinetadm\fR(8),
637 \fBkadb\fR(8), \fBsvcadm\fR(8), \fBpppd\fR(8), \fBkeytables\fR(4),
638 \fBattributes\fR(5), \fBsmf\fR(5), \fBkb\fR(7M), \fBzs\fR(7D), \fBse\fR(7D),
639 \fBasy\fR(7D), \fBvirtualkm\fR(7D)
640 .SH NOTES
643 Some server systems have key switches with a \fBsecure\fR key position that can
644 be read by system software. This key position overrides the normal default of
645 the keyboard abort sequence effect and changes the default so the effect is
646 disabled. When the key switch is in the \fBsecure\fR position on these systems,
647 the keyboard abort sequence effect cannot be overridden by the software
648 default, which is settable with the \fBkbd\fR utility.
651 Currently, there is no way to determine the state of the keyboard click
652 setting.
655 The \fBkdb\fR service is managed by the service management facility,
656 \fBsmf\fR(5), under the service identifier:
658 .in +2
660 svc:/system/keymap:default
662 .in -2
667 Administrative actions on this service, such as enabling, disabling, or
668 requesting restart, can be performed using \fBsvcadm\fR(8). Responsibility for
669 initiating and restarting this service is delegated to \fBinetd\fR(8). Use
670 \fBinetadm\fR(8) to make configuration changes and to view configuration
671 information for this service. The service's status can be queried using the
672 \fBsvcs\fR(1) command.