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