xref: /illumos-gate/usr/src/man/man1/kbd.1 (revision dfc4fe31363cc213fe0423dc162bc08298c796cd)
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 1M .
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 zs 7D ,
109.Xr se 7D ,
110and
111.Xr asy 7D .
112.Pp
113On many systems, the default effect of the keyboard abort sequence is to
114suspend the operating system and enter the debugger or the monitor.
115Some systems feature key switches with a
116.Sy secure
117position.
118On these systems, setting the key switch to the
119.Sy secure
120position overrides any software default set with this command.
121.Sh OPTIONS
122The following options are suported:
123.Bl -hang
124.It Fl a Ar enable | Ar disable | Ar alternate
125.Pp
126Enables, disables, or alternates the keyboard abort sequence effect.
127By default, a keyboard abort sequence suspends the operating system on most
128systems.
129This sequence is typically
130.Sy Stop-A
131or
132.Sy L1-A
133and
134.Sy Shift-Pause
135on the keyboard on
136.Sy SPARC
137systems,
138.Sy F1-A
139and
140.Sy Shift-Pause
141on x86 systems, and
142.Sy BREAK
143on the serial console device.
144.Pp
145The default keyboard behavior can be changed using this option.
146The
147.Fl a
148option can only be used by a super-user.
149.Bl -hang
150.It Ar enable
151Enables the default effect of the keyboard abort sequence (suspend the
152operating system and enter the debugger or the monitor).
153.It Ar disable
154Disables the default/alternate effect and ignores keyboard abort sequences.
155.It Ar alternate
156Enables the alternate effect of the keyboard abort sequences (suspend the
157operating system and enter the debugger or the monitor) upon receiving the
158Alternate Break character sequence on the console.
159The Alternate Break sequence is defined by the drivers
160.Xr asy 7D ,
161.Xr se 7D ,
162.Xr zs 7D .
163Due to a risk of incorrect sequence interpretation, binary protocols cannot be
164run over the serial console port when this value is used.
165.El
166.It Fl A Ar count
167.Pp
168Sets autorepeat count.
169Value
170.Sy -1
171denotes unlimited autorepeat (default).
172.It Fl b Ar keyboard | Ar console
173.Pp
174Sets the beeper frequency for keyboard or console.
175.Bl -hang
176.It Ar keyboard
177Set the keyboard beeper frequency to the operand in HZ.
178See
179.Sx OPERANDS .
180.It Ar console
181Sets the console beeper frequency to the operand in HZ.
182See
183.Sx OPERANDS .
184.El
185.It Fl c Ar on | Ar off
186.Pp
187Turns the clicking of the keyboard on or off.
188.Bl -hang
189.It Ar on
190Enables clicking
191.It Ar off
192Disables clicking
193.El
194.It Fl d Ar keyboard device
195.Pp
196Specifies the keyboard device being set.
197The default setting is
198.Pa /dev/kbd .
199.It Fl D Ar autorepeat delay
200.Pp
201Sets the autorepeat delay in milliseconds.
202.It Fl i
203.Pp
204Sets keyboard properties from the keyboard default file.
205With the exception of
206.Fl d Ar keyboard device ,
207this option cannot be used with any other option.
208The
209.Fl i
210option instructs the keyboard command to read and process
211keyclick and keyboard abort default values from the keyboard configuration
212service,
213.Sy svc:/system/keymap:default .
214The
215.Fl i
216option can only be used by a user or role with the
217.Sy Device Security Rights Profile .
218.It Fl l
219.Pp
220Returns the layout code of the keyboard being used, and the autorepeat delay
221and autorepeat rate being used.
222.Pp
223If used with
224.Fl R
225or
226.Fl D
227option, this option returns the value before the changes.
228.It Fl r
229Resets the keyboard as if power-up.
230.It Fl R Ar autorepeat rate
231.Pp
232Sets the autorepeat rate in milliseconds.
233.It Fl s Op Ar language
234.Pp
235Sets the keyboard layout into the kernel.
236.Pp
237If
238.Ar language
239is specified, the layout is set to
240.Ar language ,
241and
242.Xr loadkeys 1
243runs implicitly.
244If
245.Ar language
246is not specified, a list of available layouts are presented, prompting for the
247user to specify the
248.Ar language .
249See
250.Sx OPERANDS .
251.It Fl t
252.Pp
253Returns the type of the keyboard being used.
254.El
255.Sh OPERANDS
256The following operands are supported:
257.Bl -hang
258.It Ar frequency
259The frequency value specified to be set in kernel.
260The receiver of this value is specified by the
261.Fl b
262option.
263This value should be between 0 and 32767 otherwise will be ejected with
264.Sy EINVAL .
265.It Ar language
266The language specified to be set in kernel.
267If the language is not found, the languages supported are listed for selection.
268It only applies to
269.Fl s
270option.
271.El
272.Sh FILES
273.Bl -ohang
274.It Pa /dev/kbd
275Keyboard device file.
276.El
277.Sh EXAMPLES
278.Bl -ohang
279.It Sy Example 1 Displaying the Keyboard Type
280.Pp
281The following example displays the keyboard type:
282.Pp
283.Dl example% kbd -t
284.Dl Type 4 Sun keyboard
285.Dl example%
286.El
287.Bl -ohang
288.It Sy Example 2 Setting Keyboard Defaults
289.Pp
290The following example sets the keyboard defaults as specified in the keyboard
291default file:
292.Pp
293.Dl example# kbd -i
294.Dl example#
295.El
296.Bl -ohang
297.It Sy Example 3 Displaying Information
298.Pp
299The following example displays keyboard type and layout code.
300It also displays auto repeat delay, rate and count settings.
301.Pp
302.Dl example% kbd -l
303.Dl type=6
304.Dl layout=274 (0x112)
305.Dl delay(ms)=500
306.Dl rate(ms)=40
307.Dl count=unlimited
308.Dl example%
309.El
310.Bl -ohang
311.It Sy Example 4 Setting Keyboard Autorepeat Delay
312.Pp
313The following example sets the keyboard autorepeat delay:
314.Pp
315.Dl example% kbd -D 300
316.Dl example%
317.El
318.Bl -ohang
319.It Sy Example 5 Setting Keyboard Autorepeat Rate
320.Pp
321The following example sets the keyboard autorepeat rate:
322.Pp
323.Dl example% kbd -R 50
324.Dl example%
325.El
326.Bl -ohang
327.It Sy Example 6 Selecting and Setting the Keyboard Language
328.Pp
329The following example selects and sets the keyboard language from a list of
330languages specified:
331.Pp
332.Bd -literal -offset indent -compact
333example% kbd -s
3341. Albanian                      16. Malta_UK
3352. Belarusian                    17. Malta_US
3363. Belgian                       18. Norwegian
3374. Bulgarian                     19. Portuguese
3385. Croatian                      20. Russian
3396. Danish                        21. Serbia-And-Montenegro
3407. Dutch                         22. Slove
341\&......
342
343To select the keyboard layout, enter a number [default n]:
344
345example%
346.Ed
347.Pp
348The following example sets the keyboard language specified:
349.Pp
350.Dl example% kbd -s Dutch
351.Dl example%
352.El
353.Bl -ohang
354.It Sy Example 7 Setting the Keyboard Beeper Frequency
355.Pp
356The following example sets the keyboard beeper frequency:
357.Pp
358.Dl example% kbd -b keyboard 1000
359.Dl example%
360.El
361.Sh SEE ALSO
362.Xr loadkeys 1 ,
363.Xr svcs 1 ,
364.Xr kadb 1M ,
365.Xr pppd 1M ,
366.Xr svcadm 1M ,
367.Xr keytables 4 ,
368.Xr attributes 5 ,
369.Xr smf 5 ,
370.Xr asy 7D ,
371.Xr se 7D ,
372.Xr virtualkm 7D ,
373.Xr zs 7D ,
374.Xr kb 7M
375.Sh NOTES
376Some server systems have key switches with a
377.Sy secure
378key position that can be read by system software.
379This key position overrides the normal default of the keyboard abort sequence
380effect and changes the default so the effect is disabled.
381When the key switch is in the
382.Sy secure
383position on these systems, the keyboard abort sequence effect cannot be
384overridden by the software default, which is settable with the
385.Nm
386utility.
387.Pp
388Currently, there is no way to determine the state of the keyboard click
389setting.
390.Pp
391The
392.Nm
393service is managed by the service management facility,
394.Xr smf 5 ,
395under the service identifier:
396.Pp
397.Dl svc:/system/keymap:default
398.Pp
399Administrative actions on this service, such as enabling, disabling, or
400requesting restart, can be performed using
401.Xr svcadm 1M .
402Use
403.Xr svccfg 1M
404to make configuration changes and to view configuration information for this
405service.
406The service's status can be queried using the
407.Xr svcs 1
408command.
409