xref: /illumos-gate/usr/src/man/man1/kbd.1 (revision 9726429325e0e93eb1a1f724f6db6a9fd6ad63ce)
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.Dd April 29, 2019
7.Dt KBD 1
8.Os
9.Sh NAME
10.Nm kbd
11.Nd
12manipulate the state of keyboard, or display the type of keyboard, or
13change the default keyboard abort sequence effect
14.Sh SYNOPSIS
15.Nm
16.Op Fl r
17.Op Fl t
18.Op Fl l
19.Op Fl a Ar enable | Ar disable | Ar alternate
20.Op Fl c Ar on | Ar off
21.Op Fl d Ar keyboard device
22.Op Fl A Ar autorepeat count
23.Op Fl D Ar autorepeat delay
24.Op Fl R Ar autorepeat rate
25.Nm
26.Op Fl i
27.Op Fl d Ar keyboard device
28.Nm
29.Fl s Op Ar language
30.Nm
31.Fl b Op Ar keyboard | Ar console
32.Ar frequency
33.Sh DESCRIPTION
34The
35.Nm
36utility manipulates the state of the keyboard, or displays the
37keyboard type, or allows the default keyboard abort sequence effect to be
38changed.
39The abort sequence also applies to serial console devices.
40The
41.Nm
42utility sets the
43.Pa /dev/kbd
44default keyboard device.
45.Sh EXTENDED DESCRIPTION
46The
47.Fl i
48option reads and processes default values for the keyclick and
49keyboard abort settings from the keyboard configuration service,
50.Sy svc:/system/keymap:default .
51Only keyboards that support a clicker respond to the
52.Fl c
53option.
54.Pp
55The keyboard abort sequence effect can only be changed by a super-user using
56the
57.Fl a
58option.
59This sequence is typically Stop-A or L1-A and Shift-Pause on the keyboard on
60.Sy SPARC
61systems, F1-A and Shift-Pause on x86 systems,
62and BREAK on the serial console input device on most systems.
63.Pp
64A
65.Sy BREAK
66condition that originates from an erroneous electrical signal
67cannot be distinguished from one deliberately sent by remote
68.Sy DCE .
69As a remedy, use the
70.Fl a
71option with Alternate Break to switch break interpretation.
72Due to the risk of incorrect sequence interpretation, binary
73protocols such as
74.Sy SLIP
75and others should not be run over the serial console port when Alternate Break
76sequence is in effect.
77.Pp
78Although PPP is a binary protocol, it has the ability to avoid using characters
79that interfere with serial operation.
80The default alternate break sequence is
81CTRL-m
82.Sy ~
83CTRL-b, or
84.Sy 0D 7E 02
85in hexadecimal.
86In PPP, this can be avoided by setting either
87.Sy 0x00000004
88or
89.Sy 0x00002000
90in the ACCM.
91This forces an escape for the CTRL-b or CTRL-m characters, respectively.
92.Pp
93To do this in Solaris PPP 4.0, add:
94.Pp
95.Dl asyncmap 0x00002000
96.Pp
97to the
98.Pa /etc/ppp/options
99file or any of the other configuration files used for the connection.
100See
101.Xr pppd 8 .
102.Pp
103SLIP has no comparable capability, and must not be used if the Alternate Break
104sequence is in use.
105.Pp
106The Alternate Break sequence has no effect on the keyboard abort.
107For more information on the Alternate Break sequence, see
108.Xr asy 4D .
109.Pp
110On many systems, the default effect of the keyboard abort sequence is to
111suspend the operating system and enter the debugger or the monitor.
112Some systems feature key switches with a
113.Sy secure
114position.
115On these systems, setting the key switch to the
116.Sy secure
117position overrides any software default set with this command.
118.Sh OPTIONS
119The following options are supported:
120.Bl -hang
121.It Fl a Ar enable | Ar disable | Ar alternate
122.Pp
123Enables, disables, or alternates the keyboard abort sequence effect.
124By default, a keyboard abort sequence suspends the operating system on most
125systems.
126This sequence is typically
127.Sy Stop-A
128or
129.Sy L1-A
130and
131.Sy Shift-Pause
132on the keyboard on
133.Sy SPARC
134systems,
135.Sy F1-A
136and
137.Sy Shift-Pause
138on x86 systems, and
139.Sy BREAK
140on the serial console device.
141.Pp
142The default keyboard behavior can be changed using this option.
143The
144.Fl a
145option can only be used by a super-user.
146.Bl -hang
147.It Ar enable
148Enables the default effect of the keyboard abort sequence (suspend the
149operating system and enter the debugger or the monitor).
150.It Ar disable
151Disables the default/alternate effect and ignores keyboard abort sequences.
152.It Ar alternate
153Enables the alternate effect of the keyboard abort sequences (suspend the
154operating system and enter the debugger or the monitor) upon receiving the
155Alternate Break character sequence on the console.
156The Alternate Break sequence is defined by the
157.Xr asy 4D
158driver.
159Due to a risk of incorrect sequence interpretation, binary protocols cannot be
160run over the serial console port when this value is used.
161.El
162.It Fl A Ar count
163.Pp
164Sets autorepeat count.
165Value
166.Sy -1
167denotes unlimited autorepeat (default).
168.It Fl b Ar keyboard | Ar console
169.Pp
170Sets the beeper frequency for keyboard or console.
171.Bl -hang
172.It Ar keyboard
173Set the keyboard beeper frequency to the operand in HZ.
174See
175.Sx OPERANDS .
176.It Ar console
177Sets the console beeper frequency to the operand in HZ.
178See
179.Sx OPERANDS .
180.El
181.It Fl c Ar on | Ar off
182.Pp
183Turns the clicking of the keyboard on or off.
184.Bl -hang
185.It Ar on
186Enables clicking
187.It Ar off
188Disables clicking
189.El
190.It Fl d Ar keyboard device
191.Pp
192Specifies the keyboard device being set.
193The default setting is
194.Pa /dev/kbd .
195.It Fl D Ar autorepeat delay
196.Pp
197Sets the autorepeat delay in milliseconds.
198.It Fl i
199.Pp
200Sets keyboard properties from the keyboard default file.
201With the exception of
202.Fl d Ar keyboard device ,
203this option cannot be used with any other option.
204The
205.Fl i
206option instructs the keyboard command to read and process
207keyclick and keyboard abort default values from the keyboard configuration
208service,
209.Sy svc:/system/keymap:default .
210The
211.Fl i
212option can only be used by a user or role with the
213.Sy Device Security Rights Profile .
214.It Fl l
215.Pp
216Returns the layout code of the keyboard being used, and the autorepeat delay
217and autorepeat rate being used.
218.Pp
219If used with
220.Fl R
221or
222.Fl D
223option, this option returns the value before the changes.
224.It Fl r
225Resets the keyboard as if power-up.
226.It Fl R Ar autorepeat rate
227.Pp
228Sets the autorepeat rate in milliseconds.
229.It Fl s Op Ar language
230.Pp
231Sets the keyboard layout into the kernel.
232.Pp
233If
234.Ar language
235is specified, the layout is set to
236.Ar language ,
237and
238.Xr loadkeys 1
239runs implicitly.
240If
241.Ar language
242is not specified, a list of available layouts are presented, prompting for the
243user to specify the
244.Ar language .
245See
246.Sx OPERANDS .
247.It Fl t
248.Pp
249Returns the type of the keyboard being used.
250.El
251.Sh OPERANDS
252The following operands are supported:
253.Bl -hang
254.It Ar frequency
255The frequency value specified to be set in kernel.
256The receiver of this value is specified by the
257.Fl b
258option.
259This value should be between 0 and 32767 otherwise will be ejected with
260.Sy EINVAL .
261.It Ar language
262The language specified to be set in kernel.
263If the language is not found, the languages supported are listed for selection.
264It only applies to
265.Fl s
266option.
267.El
268.Sh FILES
269.Bl -ohang
270.It Pa /dev/kbd
271Keyboard device file.
272.El
273.Sh EXAMPLES
274.Bl -ohang
275.It Sy Example 1 Displaying the Keyboard Type
276.Pp
277The following example displays the keyboard type:
278.Pp
279.Dl example% kbd -t
280.Dl Type 4 Sun keyboard
281.Dl example%
282.El
283.Bl -ohang
284.It Sy Example 2 Setting Keyboard Defaults
285.Pp
286The following example sets the keyboard defaults as specified in the keyboard
287default file:
288.Pp
289.Dl example# kbd -i
290.Dl example#
291.El
292.Bl -ohang
293.It Sy Example 3 Displaying Information
294.Pp
295The following example displays keyboard type and layout code.
296It also displays auto repeat delay, rate and count settings.
297.Pp
298.Dl example% kbd -l
299.Dl type=6
300.Dl layout=274 (0x112)
301.Dl delay(ms)=500
302.Dl rate(ms)=40
303.Dl count=unlimited
304.Dl example%
305.El
306.Bl -ohang
307.It Sy Example 4 Setting Keyboard Autorepeat Delay
308.Pp
309The following example sets the keyboard autorepeat delay:
310.Pp
311.Dl example% kbd -D 300
312.Dl example%
313.El
314.Bl -ohang
315.It Sy Example 5 Setting Keyboard Autorepeat Rate
316.Pp
317The following example sets the keyboard autorepeat rate:
318.Pp
319.Dl example% kbd -R 50
320.Dl example%
321.El
322.Bl -ohang
323.It Sy Example 6 Selecting and Setting the Keyboard Language
324.Pp
325The following example selects and sets the keyboard language from a list of
326languages specified:
327.Pp
328.Bd -literal -offset indent -compact
329example% kbd -s
3301. Albanian                      16. Malta_UK
3312. Belarusian                    17. Malta_US
3323. Belgian                       18. Norwegian
3334. Bulgarian                     19. Portuguese
3345. Croatian                      20. Russian
3356. Danish                        21. Serbia-And-Montenegro
3367. Dutch                         22. Slove
337\&......
338
339To select the keyboard layout, enter a number [default n]:
340
341example%
342.Ed
343.Pp
344The following example sets the keyboard language specified:
345.Pp
346.Dl example% kbd -s Dutch
347.Dl example%
348.El
349.Bl -ohang
350.It Sy Example 7 Setting the Keyboard Beeper Frequency
351.Pp
352The following example sets the keyboard beeper frequency:
353.Pp
354.Dl example% kbd -b keyboard 1000
355.Dl example%
356.El
357.Sh SEE ALSO
358.Xr loadkeys 1 ,
359.Xr svcs 1 ,
360.Xr asy 4D ,
361.Xr virtualkm 4D ,
362.Xr kb 4M ,
363.Xr keytables 5 ,
364.Xr attributes 7 ,
365.Xr smf 7 ,
366.Xr kadb 8 ,
367.Xr pppd 8 ,
368.Xr svcadm 8
369.Sh NOTES
370Some server systems have key switches with a
371.Sy secure
372key position that can be read by system software.
373This key position overrides the normal default of the keyboard abort sequence
374effect and changes the default so the effect is disabled.
375When the key switch is in the
376.Sy secure
377position on these systems, the keyboard abort sequence effect cannot be
378overridden by the software default, which is settable with the
379.Nm
380utility.
381.Pp
382Currently, there is no way to determine the state of the keyboard click
383setting.
384.Pp
385The
386.Nm
387service is managed by the service management facility,
388.Xr smf 7 ,
389under the service identifier:
390.Pp
391.Dl svc:/system/keymap:default
392.Pp
393Administrative actions on this service, such as enabling, disabling, or
394requesting restart, can be performed using
395.Xr svcadm 8 .
396Use
397.Xr svccfg 8
398to make configuration changes and to view configuration information for this
399service.
400The service's status can be queried using the
401.Xr svcs 1
402command.
403