xref: /freebsd/usr.sbin/kbdcontrol/kbdmap.5 (revision bc96366c864c07ef352edb92017357917c75b36c)
1.\" Copyright (c) 2000
2.\"	David Malone
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.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd January 29, 2008
28.Dt KBDMAP 5
29.Os
30.Sh NAME
31.Nm kbdmap
32.Nd keyboard map file format for kbdcontrol
33.Sh SYNOPSIS
34.Nm
35.Sh DESCRIPTION
36A
37.Nm
38file describes how the keys on a keyboard should behave.
39These files can be loaded
40using
41.Xr kbdcontrol 1 ,
42or
43.Xr kbdmap 1
44can be used to select one of the default
45.Nm
46files interactively.
47A
48.Nm
49file can be specified in
50.Xr rc.conf 5 ,
51to be loaded
52at boot time.
53The current keymap may also be printed using
54.Xr kbdcontrol 1 .
55.Pp
56Each line in the file
57can describe a key or an accent.
58A
59.Ql #
60character begins a comment,
61which extends to the end of the line.
62.Pp
63The description of a key
64begins with the scancode for that key.
65Then the effect of the key
66under combinations of
67shift,
68control
69and alt
70are listed in the following order:
71no modifier,
72shift,
73control,
74control and shift,
75alt,
76alt and shift,
77alt and control,
78alt and control and shift.
79The action of the key
80under each modifier can be:
81.Bl -tag -width Ar
82.It ' Ns Ar symbol Ns No '
83The symbol the key should produce,
84in single quotes.
85.It Ar decnum
86The
87.Tn Unicode
88value to produce
89as a decimal number
90(see
91.Xr ascii 7 ) .
92For example, 32 for space.
93.It 0x Ns Ar hexnum
94The
95.Tn Unicode
96value to produce
97as a hexadecimal number.
98For example, 0x20 for space.
99.It Ar ctrlname
100One of the standard names
101for the
102.Tn ASCII
103control characters:
104nul,
105soh,
106stx,
107etx,
108eot,
109enq,
110ack,
111bel,
112bs,
113ht,
114nl,
115vt,
116np,
117cr,
118so,
119si,
120dle,
121dc1,
122dc2,
123dc3,
124dc4,
125nak,
126syn,
127etb,
128can,
129em,
130sub,
131esc,
132fs,
133gs,
134rs,
135ns,
136us,
137sp,
138del.
139.It Ar accentname
140By giving one of the accent names,
141the next key pressed will produce
142an accented character
143in accordance with that accent.
144See the description of accents below.
145The accent names are:
146dgra,
147dacu,
148dcir,
149dtil,
150dmac,
151dbre,
152ddot,
153duml,
154ddia,
155dsla,
156drin,
157dced,
158dapo,
159ddac,
160dogo,
161dcar.
162.It fkey Ns Ar N
163Act as the
164.Ar N Ns No th
165function key,
166where
167.Ar N
168is a decimal number in the range from 1 to 96.
169Refer to the
170.Xr atkbd 4
171manual page for a list of predefined function keys.
172You can use the
173.Fl f
174option of the
175.Xr kbdcontrol 1
176utility to assign arbitrary strings to function keys.
177.It lshift
178Act as left shift key.
179.It rshift
180Act as right shift key.
181.It clock
182Act as caps lock key.
183.It nlock
184Act as num lock key.
185.It slock
186Act as scroll lock key.
187.It lalt|alt
188Act as left alt key.
189.It btab
190Act as backwards tab.
191.It lctrl|ctrl
192Act as left control key.
193.It rctrl
194Act as right control key.
195.It ralt
196Act as right alt (altgr) key.
197.It alock
198Act as alt lock key.
199.It ashift
200Act as alt shift key.
201.It meta
202Act as meta key.
203.It lshifta|shifta
204Act as left shift key / alt lock.
205.It rshifta
206Act as right shift key / alt lock.
207.It lctrla|ctrla
208Act as left ctrl key / alt lock.
209.It rctrla
210Act as right ctrl key / alt lock.
211.It lalta|alta
212Act as left alt key / alt lock.
213.It ralta
214Act as right alt key / alt lock.
215.It nscr
216Act as switch to next screen.
217.It pscr
218Act as switch to previous screen.
219.It scr Ns Ar N
220Switch to screen
221.Ar N ,
222where
223.Ar N
224is a decimal number.
225.It boot
226Reboot the machine.
227.It halt
228Halt the machine.
229.It pdwn
230Halt the machine
231and attempt to power it down.
232.It debug
233Call the debugger.
234.It susp
235Use APM to suspend power.
236.It saver
237Activate screen saver
238by toggling between splash/text screen.
239.It panic
240Panic the system.
241The
242.Xr sysctl 8
243variable
244.Va machdep.enable_panic_key
245must be set to 1 to enable this feature.
246.It paste
247Act as mouse buffer paste.
248.El
249.Pp
250Finally,
251to complete the description of a key,
252a flag which describes
253the effect of caps lock and num lock
254on that key is given.
255The flag can be
256.Ql C
257to indicate that caps lock affects the key,
258.Ql N
259to indicate that num lock affects the key,
260.Ql B
261to indicate that both
262caps lock and num lock affects the key,
263or
264.Ql O
265to indicate that neither affects the key.
266.Pp
267An accent key works
268by modifying the behavior
269of the next key pressed.
270The description of an accent begins
271with one of the accent names
272given above.
273This is followed
274by the symbol for the accent,
275given in single quotes or
276as a decimal or hexadecimal
277.Tn Unicode
278value.
279This symbol will be produced
280if the accent key is pressed and
281then the space key is pressed.
282.Pp
283The description of the accent key
284continues with a list showing
285how it modifies various symbols,
286by giving pairs made up of the normal symbol and
287the modified symbol
288enclosed in parentheses.
289Both symbols in a pair can be given
290in either single quotes or
291as decimal or
292hexadecimal
293.Tn Unicode
294values.
295.Pp
296For example,
297consider the following extract from a
298.Nm :
299.Bd -literal -offset indent
300  041   dgra   172    nop    nop    '|'    '|'    nop    nop     O
301  dgra  '`'  ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 )
302             ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 )
303             ( 'u' 249 ) ( 'U' 217 )
304.Ed
305This extract
306configures the backtick key on a UK keyboard
307to act as a grave accent key.
308Pressing backtick followed by space
309produces a backtick, and
310pressing a backtick followed by a vowel
311produces the ISO-8859-1 symbol
312for that vowel with a grave accent.
313.Sh FILES
314.Bl -tag -width /usr/share/syscons/keymaps/* -compact
315.It Pa /usr/share/syscons/keymaps/*
316standard keyboard map files for syscons
317.It Pa /usr/share/vt/keymaps/*
318standard keyboard map files for vt
319.El
320.Sh SEE ALSO
321.Xr kbdcontrol 1 ,
322.Xr kbdmap 1 ,
323.Xr keyboard 4 ,
324.Xr syscons 4 ,
325.Xr vt 4 ,
326.Xr ascii 7
327.Sh HISTORY
328This manual page first appeared in
329.Fx 4.2 .
330