xref: /freebsd/usr.sbin/kbdcontrol/kbdcontrol.1 (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1.\"
2.\" kbdcontrol - a utility for manipulating the syscons or vt keyboard driver section
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\"     @(#)kbdcontrol.1
14.\" $FreeBSD$
15.\"
16.Dd March 16, 2016
17.Dt KBDCONTROL 1
18.Os
19.Sh NAME
20.Nm kbdcontrol
21.Nd keyboard control and configuration utility
22.Sh SYNOPSIS
23.Nm
24.Op Fl dFKix
25.Op Fl A Ar name
26.Op Fl a Ar name
27.Oo
28.Fl b
29.Ar duration . Ns Ar pitch | Ar belltype
30.Oc
31.Oo
32.Fl r
33.Ar delay . Ns Ar repeat | Ar speed
34.Oc
35.Op Fl l Ar keymap_file
36.Op Fl f Ar # Ar string
37.Op Fl k Ar keyboard_device
38.Op Fl L Ar keymap_file
39.Op Fl P Ar path
40.Sh DESCRIPTION
41The
42.Nm
43command is used to set various keyboard related options for the
44.Xr syscons 4
45or
46.Xr vt 4
47console driver and the keyboard drivers,
48such as key map, keyboard repeat and delay rates, bell
49characteristics etc.
50.Pp
51Keyboard options may be automatically configured at system boot time by
52setting variables in
53.Pa /etc/rc.conf .
54See
55.Sx Boot Time Configuration
56below.
57.Pp
58The following command line options are supported:
59.Bl -tag -width indent
60.It Fl A Ar name
61Detach the keyboard, specified by the keyboard device name, from the keyboard
62multiplexer.
63When using this option, the standard input of the
64.Nm
65process should be redirected from the keyboard multiplexer keyboard device
66(if the keyboard multiplexer is not the active keyboard) or
67.Pa /dev/console
68(if the keyboard multiplexer is the active keyboard and
69you are not working on the system console).
70.It Fl a Ar name
71Attach the keyboard, specified by the keyboard device name, to the keyboard
72multiplexer.
73When using this option, the standard input of the
74.Nm
75process should be redirected from the keyboard multiplexer keyboard device
76(if the keyboard multiplexer is not the active keyboard) or
77.Pa /dev/console
78(if the keyboard multiplexer is the active keyboard and
79you are not working on the system console).
80.It Fl b Xo
81.Ar duration . Ns Ar pitch | Ar belltype
82.Xc
83Set the bell duration in milliseconds and pitch in hertz.
84If a
85.Ar belltype
86argument is specified, it may be one of
87.Cm normal
88which sets sound parameters back to normal values,
89.Cm off
90which disables the bell entirely, or
91.Cm visual
92which sets the bell to visual mode, i.e., flashes the screen instead.
93If
94.Ar belltype
95is preceded by the word
96.Cm quiet. ,
97the bell will not be rung when the ringing process is in the background vty.
98The
99.Cm visual
100bell, when chosen, applies to all vtys; other bell types
101can be set individually for each vty.
102.It Fl r Xo
103.Ar delay . Ns Ar repeat | Ar speed
104.Xc
105Set keyboard
106.Ar delay
107(250, 500, 750, 1000)
108and
109.Ar repeat
110(34, 38, 42, 46, 50, 55, 59, 63, 68, 76, 84, 92, 100, 110, 118, 126,
111136, 152, 168, 184, 200, 220, 236, 252, 272, 304, 336, 368, 400, 440,
112472, 504)
113rates, or if a
114.Ar speed
115argument is specified, it may be one of
116.Cm slow
117(1000.504),
118.Cm fast
119(250.34)
120or
121.Cm normal
122(500.126).
123.It Fl l Ar keymap_file
124Install keyboard map file from
125.Ar keymap_file .
126You may load the keyboard map file from a menu-driven command,
127.Xr kbdmap 1 .
128The format of keyboard map files is documented in the
129.Xr kbdmap 5
130manual page.
131.It Fl d
132Dump the current keyboard map onto stdout.
133The output may be redirected to a file and can be loaded
134back to the kernel later by the
135.Fl l
136option above.
137.It Fl f Ar # Ar string
138Set function key number
139.Ar #
140to send
141.Ar string .
142Refer to the man page for the keyboard driver
143(e.g.\&
144.Xr atkbd 4 )
145for available function keys and their numbers.
146.It Fl F
147Set function keys back to the standard definitions.
148.It Fl x
149Use hexadecimal numbers in keyboard map dump.
150.It Fl i
151Print brief information about the keyboard.
152.It Fl K
153Disconnect the keyboard from the console.
154You need to use the
155.Fl k
156option below to associate a keyboard with the console again.
157.It Fl k Ar keyboard_device
158Use the specified device as the console keyboard.
159When using this option, the standard input of the
160.Nm
161process should be redirected from
162.Pa /dev/console
163if you are not working on the system console
164(see the
165.Sx EXAMPLES
166section).
167.It Fl L Ar keymap_file
168Load keyboard map file from
169.Ar keymap_file
170and write the
171.Ft "struct keymap"
172compiled from it to stdout.
173This option is primarily intended for programmers and is probably
174of little use under normal circumstances.
175.It Fl P Ar path
176Search for the keymap file in
177.Ar path .
178The
179.Fl P
180option may be specified multiple times.
181.El
182.Sh ENVIRONMENT
183The environment variable
184.Ev KEYMAP_PATH
185can hold an alternative path to the keyboard map files.
186.Sh KEYBOARD CONFIGURATION
187.Ss Boot Time Configuration
188You may set variables in
189.Pa /etc/rc.conf
190or
191.Pa /etc/rc.conf.local
192in order to configure the keyboard at boot time.
193The following is the list of relevant variables.
194.Pp
195.Bl -tag -width foo_bar_var -compact
196.It Ar keymap
197Specifies a keyboard map file for the
198.Fl l
199option.
200.It Ar keyrate
201Sets the keyboard repeat rate for the
202.Fl r
203option.
204.It Ar keychange
205Lists function key strings for the
206.Fl f
207option.
208.El
209.Pp
210See
211.Xr rc.conf 5
212for details.
213.Ss Driver Configuration
214The keyboard device driver may let you change default configuration
215options, such as the default keyboard map, so that you do not need to set up
216the options at boot time.
217See keyboard driver manuals
218(e.g.\&
219.Xr atkbd 4 ,
220.Xr ukbd 4 )
221for details.
222.Sh FILES
223.Bl -tag -width /usr/share/syscons/keymaps/foo_bar -compact
224.It Pa /usr/share/syscons/keymaps/*
225keyboard map files for syscons
226.It Pa /usr/share/vt/keymaps/*
227keyboard map files for vt
228.El
229.Sh EXAMPLES
230The following command will load the keyboard map file
231.Pa /usr/share/syscons/keymaps/ru.koi8-r.kbd .
232.Pp
233.Dl kbdcontrol -l /usr/share/syscons/keymaps/ru.koi8-r.kbd
234.Pp
235So long as the keyboard map file resides in
236.Pa /usr/share/syscons/keymaps
237(if using
238.Xr syscons 4 ) or
239.Pa /usr/share/vt/keymaps
240(if using
241.Xr vt 4 ) ,
242you may abbreviate the file name as
243.Pa ru.koi8-r .
244Since
245.Xr vt 4
246uses Unicode, the corresponding keyboard file names omit the encoding
247and typically are just a country code, e.g.\&
248.Pa ru .
249.Pp
250.Dl kbdcontrol -l ru.koi8-r
251.Pp
252The following command will make the function key 10 emit "telnet myhost".
253.Pp
254.Dl kbdcontrol -f 10 \&"telnet myhost\&"
255.Pp
256In order to get the visual effect for bell, but prevent the screen
257from flashing if the bell is to ring in the background screen,
258run the following command.
259.Pp
260.Dl kbdcontrol -b quiet.visual
261.Pp
262To change the default console keyboard to another keyboard,
263for example the first USB keyboard (see
264.Xr ukbd 4 ) ,
265use the following command.
266.Pp
267.Dl kbdcontrol -k /dev/ukbd0 < /dev/console
268.Pp
269To switch back to the default keyboard, use this command.
270.Pp
271.Dl kbdcontrol -k /dev/kbd0
272.Pp
273To allow using both the second USB keyboard and the first AT keyboard
274at the same time on console via the
275.Xr kbdmux 4
276driver, use the following sequence of commands.
277.Bd -literal -offset indent
278kbdcontrol -K < /dev/console
279kbdcontrol -a atkbd0 < /dev/kbdmux0
280kbdcontrol -a ukbd1 < /dev/kbdmux0
281kbdcontrol -k /dev/kbdmux0 < /dev/console
282.Ed
283.Sh SEE ALSO
284.Xr kbdmap 1 ,
285.Xr vidcontrol 1 ,
286.Xr atkbd 4 ,
287.Xr kbdmux 4 ,
288.Xr keyboard 4 ,
289.Xr screen 4 ,
290.Xr syscons 4 ,
291.Xr ukbd 4 ,
292.Xr vt 4 ,
293.Xr kbdmap 5 ,
294.Xr rc.conf 5
295.Sh AUTHORS
296.An S\(/oren Schmidt Aq Mt sos@FreeBSD.org
297.Sh BUGS
298Report when found.
299