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