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