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 September 12, 2009
18.Dt KBDCONTROL 1
19.Os
20.Sh NAME
21.Nm kbdcontrol
22.Nd keyboard control and configuration utility
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
42The
43.Nm
44command is used to set various keyboard related options for the
45.Xr syscons 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 h Ar size
150Set history buffer size to
151.Ar size
152lines.
153.It Fl i
154Print brief information about the keyboard.
155.It Fl K
156Disconnect the keyboard from the console.
157You need to use the
158.Fl k
159option below to associate a keyboard with the console again.
160.It Fl k Ar keyboard_device
161Use the specified device as the console keyboard.
162When using this option, the standard input of the
163.Nm
164process should be redirected from
165.Pa /dev/console
166if you are not working on the system console
167(see the
168.Sx EXAMPLES
169section).
170.It Fl L Ar keymap_file
171Load keyboard map file from
172.Ar keymap_file
173and write the
174.Ft "struct keymap"
175compiled from it to stdout.
176This option is primarily intended for programmers and is probably
177of little use under normal circumstances.
178.El
179.Sh ENVIRONMENT
180The environment variable
181.Ev KEYMAP_PATH
182can hold an alternative path to the keyboard map files.
183.Sh KEYBOARD CONFIGURATION
184.Ss Boot Time Configuration
185You may set variables in
186.Pa /etc/rc.conf
187or
188.Pa /etc/rc.conf.local
189in order to configure the keyboard at boot time.
190The following is the list of relevant variables.
191.Pp
192.Bl -tag -width foo_bar_var -compact
193.It Ar keymap
194Specifies a keyboard map file for the
195.Fl l
196option.
197.It Ar keyrate
198Sets the keyboard repeat rate for the
199.Fl r
200option.
201.It Ar keychange
202Lists function key strings for the
203.Fl f
204option.
205.El
206.Pp
207See
208.Xr rc.conf 5
209for details.
210.Ss Driver Configuration
211The keyboard device driver may let you change default configuration
212options, such as the default keyboard map, so that you do not need to set up
213the options at boot time.
214See keyboard driver manuals
215(e.g.\&
216.Xr atkbd 4 ,
217.Xr ukbd 4 )
218for details.
219.Sh FILES
220.Bl -tag -width /usr/share/syscons/keymaps/foo_bar -compact
221.It Pa /usr/share/syscons/keymaps/*
222keyboard map files
223.El
224.Sh EXAMPLES
225The following command will load the keyboard map file
226.Pa /usr/share/syscons/keymaps/ru.koi8-r.kbd .
227.Pp
228.Dl kbdcontrol -l /usr/share/syscons/keymaps/ru.koi8-r.kbd
229.Pp
230So long as the keyboard map file resides in
231.Pa /usr/share/syscons/keymaps ,
232you may abbreviate the file name as
233.Pa ru.koi8-r .
234.Pp
235.Dl kbdcontrol -l ru.koi8-r
236.Pp
237The following command will make the function key 10 emit "telnet myhost".
238.Pp
239.Dl kbdcontrol -f 10 \&"telnet myhost\&"
240.Pp
241In order to get the visual effect for bell, but prevent the screen
242from flushing if the bell is to ring in the background screen,
243run the following command.
244.Pp
245.Dl kbdcontrol -b quiet.visual
246.Pp
247To change the default console keyboard to another keyboard,
248for example the first USB keyboard (see
249.Xr ukbd 4 ) ,
250use the following commands.
251.Pp
252.Dl kbdcontrol -k /dev/kbd1 < /dev/console
253.Pp
254To switch back to the default keyboard, use this command.
255.Pp
256.Dl kbdcontrol -k /dev/kbd0
257.Sh SEE ALSO
258.Xr kbdmap 1 ,
259.Xr vidcontrol 1 ,
260.Xr atkbd 4 ,
261.Xr kbdmux 4 ,
262.Xr keyboard 4 ,
263.Xr screen 4 ,
264.Xr syscons 4 ,
265.Xr ukbd 4 ,
266.Xr kbdmap 5 ,
267.Xr rc.conf 5
268.Sh AUTHORS
269.An S\(/oren Schmidt Aq sos@FreeBSD.org
270.Sh BUGS
271Report when found.
272