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