Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
[dragonfly.git] / usr.sbin / kbdcontrol / kbdcontrol.1
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: src/usr.sbin/kbdcontrol/kbdcontrol.1,v 1.18.2.9 2001/08/16 15:56:00 ru Exp $
15 .\" $DragonFly: src/usr.sbin/kbdcontrol/kbdcontrol.1,v 1.4 2006/02/17 19:40:16 swildner Exp $
16 .\"
17 .Dd June 30, 1999
18 .Dt KBDCONTROL 1
19 .Os
20 .Sh NAME
21 .Nm kbdcontrol
22 .Nd a utility for manipulating the syscons console driver
23 .Sh SYNOPSIS
24 .Nm
25 .Op Fl dFKix
26 .Op Fl A Ar name
27 .Op Fl a Ar name
28 .Oo
29 .Fl b
30 .Ar duration . Ns Ar pitch | Ar belltype
31 .Oc
32 .Oo
33 .Fl r
34 .Ar delay . Ns Ar repeat | Ar speed
35 .Oc
36 .Op Fl l Ar keymap_file
37 .Op Fl f Ar # Ar string
38 .Op Fl h Ar size
39 .Op Fl k Ar keyboard_device
40 .Op Fl L Ar keymap_file
41 .Sh DESCRIPTION
42 The
43 .Nm
44 command is used to set various keyboard related options for the
45 .Xr syscons 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 multilpexor keyboard device
65 (if keyboard multiplexor is not active keyboard) or
66 .Pa /dev/console
67 (if keyboard multiplexor is 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 multilpexor keyboard device
75 (if keyboard multiplexor is not active keyboard) or
76 .Pa /dev/console
77 (if keyboard multiplexor is 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 .It Fl r Xo
98 .Ar delay . Ns Ar repeat | Ar speed
99 .Xc
100 Set keyboard
101 .Ar delay
102 (250, 500, 750, 1000)
103 and
104 .Ar repeat
105 (34, 38, 42, 46, 50, 55, 59, 63, 68, 76, 84, 92, 100, 110, 118, 126,
106 136, 152, 168, 184, 200, 220, 236, 252, 272, 304, 336, 368, 400, 440,
107 472, 504)
108 rates, or if a
109 .Ar speed
110 argument is specified, it may be one of
111 .Cm slow
112 (1000.504),
113 .Cm fast
114 (250.34)
115 or
116 .Cm normal
117 (500.126).
118 .It Fl l Ar keymap_file
119 Install keyboard map file from
120 .Ar keymap_file .
121 You may load the keyboard map file from a menu-driven command,
122 .Xr kbdmap 1 .
123 .It Fl d
124 Dump the current keyboard map onto stdout.
125 The output may be redirected to a file and can be loaded
126 back to the kernel later by the
127 .Fl l
128 option above.
129 .It Fl f Ar # Ar string
130 Set function key number
131 .Ar #
132 to send
133 .Ar string .
134 Refer to the man page for the keyboard driver
135 (e.g.\&
136 .Xr atkbd 4 )
137 for available function keys and their numbers.
138 .It Fl F
139 Set function keys back to the standard definitions.
140 .It Fl x
141 Use hexadecimal numbers in keyboard map dump.
142 .It Fl h Ar size
143 Set history buffer size to
144 .Ar size
145 lines.
146 .It Fl i
147 Print brief information about the keyboard.
148 .It Fl K
149 Disconnect the keyboard from the console.
150 You need to use the
151 .Fl k
152 option below to associate a keyboard with the console again.
153 .It Fl k Ar keyboard_device
154 Use the specified device as the console keyboard.
155 When using this option, the standard input of the
156 .Nm
157 process should be redirected from
158 .Pa /dev/console
159 if you are not working on the system console
160 (see the
161 .Sx EXAMPLES
162 section).
163 .It Fl L Ar keymap_file
164 Load keyboard map file from
165 .Ar keymap_file
166 and write the
167 .Ft "struct keymap"
168 compiled from it to stdout.
169 This option is primarily intended for programmers and is probably
170 of little use under normal circumstances.
171 .El
172 .Sh KEYBOARD CONFIGURATION
173 .Ss Boot Time Configuration
174 You may set variables in
175 .Pa /etc/rc.conf
176 or
177 .Pa /etc/rc.conf.local
178 in order to configure the keyboard at boot time.
179 The following is the list of relevant variables.
180 .Pp
181 .Bl -tag -width foo_bar_var -compact
182 .It Ar keymap
183 Specifies a keyboard map file for the
184 .Fl l
185 option.
186 .It Ar keyrate
187 Sets the keyboard repeat rate for the
188 .Fl r
189 option.
190 .It Ar keychange
191 Lists function key strings for the
192 .Fl f
193 option.
194 .El
195 .Pp
196 See
197 .Xr rc.conf 5
198 for details.
199 .Ss Driver Configuration
200 The keyboard device driver may let you change default configuration
201 options, such as the default keyboard map, so that you do not need to set up
202 the options at boot time.
203 See keyboard driver manuals
204 (e.g.\&
205 .Xr atkbd 4 ,
206 .Xr ukbd 4 )
207 for details.
208 .Sh FILES
209 .Bl -tag -width /usr/share/syscons/keymaps/foo_bar -compact
210 .It Pa /usr/share/syscons/keymaps/*
211 keyboard map files
212 .El
213 .Sh EXAMPLES
214 The following command will load the keyboard map file
215 .Pa /usr/share/syscons/keymaps/ru.koi8-r.kbd .
216 .Pp
217 .Dl kbdcontrol -l /usr/share/syscons/keymaps/ru.koi8-r.kbd
218 .Pp
219 So long as the keyboard map file resides in
220 .Pa /usr/share/syscons/keymaps ,
221 you may abbreviate the file name as
222 .Pa ru.koi8-r .
223 .Pp
224 .Dl kbdcontrol -l ru.koi8-r
225 .Pp
226 The following command will make the function key 10 emit "telnet myhost".
227 .Pp
228 .Dl kbdcontrol -f 10 \&"telnet myhost\&"
229 .Pp
230 In order to get the visual effect for bell, but prevent the screen
231 from flushing if the bell is to ring in the background screen,
232 run the following command.
233 .Pp
234 .Dl kbdcontrol -b quiet.visual
235 .Pp
236 To change the default console keyboard to another keyboard,
237 for example the first USB keyboard (see
238 .Xr ukbd 4 ) ,
239 use the following commands.
240 .Pp
241 .Dl kbdcontrol -k /dev/kbd1 < /dev/console
242 .Pp
243 To switch back to the default keyboard, use this command.
244 .Pp
245 .Dl kbdcontrol -k /dev/kbd0
246 .Sh SEE ALSO
247 .Xr kbdmap 1 ,
248 .Xr vidcontrol 1 ,
249 .Xr atkbd 4 ,
250 .Xr keyboard 4 ,
251 .Xr screen 4 ,
252 .Xr syscons 4 ,
253 .Xr ukbd 4 ,
254 .Xr kbdmap 5 ,
255 .Xr rc.conf 5
256 .Sh AUTHORS
257 .An S\(/oren Schmidt Aq sos@FreeBSD.org
258 .Sh BUGS
259 Report when found.