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