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