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