User Commands kbd(1)
NAME
kbd - manipulate the state of keyboard, or display the type
of keyboard, or change the default keyboard abort sequence
effect
SYNOPSIS
kbd [-r] [-t ] [-l] [-a enable disable alternate]
[-c on off] [-d keyboard device]
[-D autorepeat delay] [-R autorepeat rate]
kbd [-i] [-d keyboard device]
kbd -s [language]
kbd -b [keyboard console] frequency
DESCRIPTION
The kbd utility manipulates the state of the keyboard, or
displays the keyboard type, or allows the default keyboard
abort sequence effect to be changed. The abort sequence also
applies to serial console devices. The kbd utility sets the
/dev/kbd default keyboard device.
EXTENDED DESCRIPTION
The -i option reads and processes default values for the
keyclick and keyboard abort settings from the
/etc/default/kbd keyboard default file. Only keyboards that
support a clicker respond to the -c option. To turn clicking
on by default, add or change the value of the KEYCLICK vari-
able in the /etc/default/kbd file to:
KEYCLICK=on
Next, run the command kbd -i to change the setting. Valid
settings for the KEYCLICK variable are on and off; all other
values are ignored. If the KEYCLICK variable is not speci-
fied in the default file, the setting is unchanged.
The keyboard abort sequence effect can only be changed by a
super-user using the -a option. This sequence is typically
Stop-A or L1-A and Shift-Pause on the keyboard on SPARC sys-
tems, F1-A and Shift-Pause on x86 systems, and BREAK on the
serial console input device on most systems.
SunOS 5.11 Last change: 29 Jan 2007 1
User Commands kbd(1)
A BREAK condition that originates from an erroneous electri-
cal signal cannot be distinguished from one deliberately
sent by remote DCE. As a remedy, use the -a option with
Alternate Break to switch break interpretation. Due to the
risk of incorrect sequence interpretation, binary protocols
such as SLIP and others should not be run over the serial
console port when Alternate Break sequence is in effect.
Although P is a binary protocol, it has the ability to
avoid using characters that interfere with serial operation.
The default alternate break sequence is CTRL-m ~ CTRL-b, or
0D 7E 02 in hexidecimal. In P, this can be avoided by set-
ting either 0x00000004 or 0x00002000 in the ACM. This
forces an escape for the CTRL-b or CTRL-m characters,
respectively.
To do this in Solaris P 4.0, add:
asyncmap 0x00002000
to the /etc/ppp/options file or any of the other configura-
tion files used for the connection. See pppd(1M).
SLIP has no comparable capability, and must not be used if
the Alternate Break sequence is in use.
The Alternate Break sequence has no effect on the keyboard
abort. For more information on the Alternate Break sequence,
see zs(7D),se(7D), and asy(7D).
On many systems, the default effect of the keyboard abort
sequence is to suspend the operating system and enter the
debugger or the monitor. Some systems feature key switches
with a secure position. On these systems, setting the key
switch to the secure position overrides any software default
set with this command.
To permanently change the software default effect of the
keyboard abort sequence, first add or change the value of
the KEYBOARDABORT variable in the /etc/default/kbd file to:
KEYBOARDABORT=disable
SunOS 5.11 Last change: 29 Jan 2007 2
User Commands kbd(1)
Next, run the command kbd -i to change the setting. Valid
settings are enable, disable, and alternate; all other
values are ignored. If the variable is not specified in the
default file, the setting is unchanged.
To set the abort sequence to the hardware BREAK, set the
value of the KEYBOARDABORT variable in the /etc/default/kbd
file to:
KEYBOARDABORT=enable
To change the current setting, run the command kbd -i. To
set the abort sequence to the Alternate Break character
sequence, first set the current value of the KEYBOARDABORT
variable in the /etc/default/kbd file to:
KEYBOARDABORT=alternate
Next, run the command kbd -i to change the setting. When the
Alternate Break sequence is in effect, only serial console
devices are affected.
To set the autorepeat delay by default, set the REPEATDELAY
variable in the file /etc/default/kbd to the expected value
with units in milliseconds (ms). To avoid making the key-
board unusable due to a typographical error, delay values
below KIOCRPTDELAYMIN (defined in /usr/include/sys/kbio.h)
are rejected with EINVAL:
REPEATDELAY=500
To set the autorepeat rate by default, set the REPEATRATE
variable in the file /etc/default/kbd to the expected value
with units in milliseconds. Negative and zero repeat rates
are ejected with EINVAL:
REPEATRATE=33
SunOS 5.11 Last change: 29 Jan 2007 3
User Commands kbd(1)
To change the current settings of delay and rate, run the
command, kbd -i. When the Auto Repeat Delay and/or Auto
Repeat Rate are in effect, only command line mode is
affected.
To set the language by default, set the LAYOUT variable in
the file /etc/default/kbd to the expected language. These
languages supported in kernel can be found by running kbd
-s. Other values are ignored. For example, the following
sets Spanish layout to the keyboard:
LAYOUT=Spanish
Next, run the kbd -i to change the setting. When Solaris
reboots, the Spanish key table is loaded into kernel. These
layouts are valid for usb and ps/2 keyboards.
To set the keyboard beeper frequency by default, set the
KBDBEPERFREQ variable in the file /etc/default/kbd to the
expected value with units in HZ. This value should be
between 0 and 32767, inclusive. Otherwise will be rejected
with EINVAL:
KBDBEPERFREQ=2000
To set the console beeper frequency by default, set the
CONSOLEBEPERFREQ variable in the file /etc/default/kbd to
the expected value with units in HZ. This value should be
between 0 and 32767, inclusive. Otherwise will be rejected
with EINVAL:
CONSOLEBEPERFREQ=900
To change the current settings of keyboard beeper frequency
and console beeper frequency, run kbd -i.
OPTIONS
The following options are supported:
-a enable disable alternate
SunOS 5.11 Last change: 29 Jan 2007 4
User Commands kbd(1)
Enables, disables, or alternates the keyboard abort
sequence effect. By default, a keyboard abort sequence
suspends the operating system on most systems. This
sequence is typically Stop-A or L1-A and Shift-Pause on
the keyboard on SPARC systems, F1-A and Shift-Pause on
x86 systems, and BREAK on the serial console device.
The default keyboard behavior can be changed using this
option. The -a option can only be used by a super-user.
enable Enables the default effect of the keyboard
abort sequence (suspend the operating sys-
tem and enter the debugger or the monitor).
disable Disables the default/alternate effect and
ignores keyboard abort sequences.
alternate Enables the alternate effect of the key-
board abort sequences (suspend the operat-
ing system and enter the debugger or the
monitor) upon receiving the Alternate Break
character sequence on the console. The
Alternate Break sequence is defined by the
drivers zs(7D), se(7D), asy(7D). Due to a
risk of incorrect sequence interpretation,
binary protocols cannot be run over the
serial console port when this value is
used.
-b keyboard console
Sets the beeper frequency for keyboard or console.
keyboard Set the keyboard beeper frequency to the
operand in HZ. See OPERANDS.
console Sets the console beeper frequency to the
operand in HZ. See OPERANDS.
-c on off
Turns the clicking of the keyboard on or off.
on Enables clicking
SunOS 5.11 Last change: 29 Jan 2007 5
User Commands kbd(1)
off Disables clicking
-d keyboard device
Specifies the keyboard device being set. The default
setting is /dev/kbd.
-D autorepeat delay
Sets the autorepeat delay in milliseconds.
-i
Sets keyboard properties from the keyboard default file.
With the exception of -d keyboard device, this option
cannot be used with any other option. The -i option
instructs the keyboard command to read and process key-
click and keyboard abort default values from the
/etc/default/kbd file. The -i option can only be used by
a user or role with the Device Security Rights Profile.
-l
Returns the layout code of the keyboard being used, and
the autorepeat delay and autorepeat rate being used.
If used with -R or -D option, this option returns the
value before the changes.
-r
Resets the keyboard as if power-up.
-R autorepeat rate
Sets the autorepeat rate in milliseconds.
-s [language]
Sets the keyboard layout into kernel.
If language is specified, the layout is set to language.
If language is not specified, a list of available lay-
outs are presented, prompting for the user to specify
SunOS 5.11 Last change: 29 Jan 2007 6
User Commands kbd(1)
the language. See OPERANDS.
-t
Returns the type of the keyboard being used.
OPERANDS
The following operands are supported:
frequency The frequency value specified to be set in ker-
nel. The receiver of this value is specified by
the -b option. This value should be between 0
and 32767 otherwise will be ejected with EIN-
VAL.
language The language specified to be set in kernel. If
the language is not found, the languages sup-
ported are listed for selection. It only
applies to -s option.
EXAMPLES
Example 1 Displaying the Keyboard Type
The following example displays the keyboard type:
example% kbd -t
Type 4 Sun keyboard
example%
Example 2 Setting Keyboard Defaults
The following example sets the keyboard defaults as speci-
fied in the keyboard default file:
example# kbd -i
example#
Example 3 Displaying Information
SunOS 5.11 Last change: 29 Jan 2007 7
User Commands kbd(1)
The following example displays keyboard type and layout
code. It also displays auto repeat delay and rate settings.
example% kbd -l
type=4
layout=43 (0x2b)
delay(ms)=500
rate(ms)=33
example%
Example 4 Setting Keyboard Autorepeat Delay
The following example sets the keyboard autorepeat delay:
example% kbd -D 300
example%
Example 5 Setting Keyboard Autorepeat Rate
The following example sets the keyboard autorepeat rate:
example% kbd -R 50
example%
Example 6 Selecting and Setting the Keyboard Language
The following example selects and sets the keyboard language
from a list of languages specified:
example% kbd -s
1. Albanian 16. MaltaUK
2. Belarusian 17. MaltaUS
3. Belgian 18. Norwegian
4. Bulgarian 19. Portuguese
5. Croatian 20. Russian
6. Danish 21. Serbia-And-Montenegro
7. Dutch 22. Slove
......
SunOS 5.11 Last change: 29 Jan 2007 8
User Commands kbd(1)
To select the keyboard layout, enter a number [default n]:
example%
The following example sets the keyboard language specified:
example% kbd -s Dutch
example%
Example 7 Setting the Keyboard Beeper Frequency
The following example sets the keyboard beeper frequency:
example% kbd -b keyboard 1000
example%
FILES
/dev/kbd Keyboard device file.
/etc/default/kbd Keyboard default file containing
software defaults for keyboard confi-
gurations.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWcsu
SEE ALSO
loadkeys(1), svcs(1), inetd(1M), inetadm(1M), kadb(1M),
svcadm(1M), pppd(1M), keytables(4), attributes(5), smf(5),
kb(7M), zs(7D), se(7D), asy(7D), virtualkm(7D)
SunOS 5.11 Last change: 29 Jan 2007 9
User Commands kbd(1)
NOTES
Some server systems have key switches with a secure key
position that can be read by system software. This key posi-
tion overrides the normal default of the keyboard abort
sequence effect and changes the default so the effect is
disabled. When the key switch is in the secure position on
these systems, the keyboard abort sequence effect cannot be
overridden by the software default, which is settable with
the kbd utility.
Currently, there is no way to determine the state of the
keyboard click setting.
The kdb service is managed by the service management facil-
ity, smf(5), under the service identifier:
svc:/system/keymap:default
Administrative actions on this service, such as enabling,
disabling, or requesting restart, can be performed using
svcadm(1M). Responsibility for initiating and restarting
this service is delegated to inetd(1M). Use inetadm(1M) to
make configuration changes and to view configuration infor-
mation for this service. The service's status can be queried
using the svcs(1) command.
SunOS 5.11 Last change: 29 Jan 2007 10
|