xref: /freebsd/usr.sbin/kbdcontrol/kbdmap.5 (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
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 2, 2016
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,
114lf,
115vt,
116ff,
117cr,
118so,
119si,
120dle,
121dc1,
122dc2,
123dc3,
124dc4,
125nak,
126syn,
127etb,
128can,
129em,
130sub,
131esc,
132fs,
133gs,
134rs,
135us,
136sp,
137del.
138.It Ar control-alias
139One of the historical aliases for certain
140.Tn ASCII
141control characters:
142nl,
143np,
144ns.
145.It Ar accentname
146By giving one of the accent names,
147the next key pressed will produce
148an accented character
149in accordance with that accent.
150See the description of accents below.
151The accent names are:
152dgra,
153dacu,
154dcir,
155dtil,
156dmac,
157dbre,
158ddot,
159duml,
160ddia,
161dsla,
162drin,
163dced,
164dapo,
165ddac,
166dogo,
167dcar.
168.It fkey Ns Ar N
169Act as the
170.Ar N Ns No th
171function key,
172where
173.Ar N
174is a decimal number in the range from 1 to 96.
175Refer to the
176.Xr atkbd 4
177manual page for a list of predefined function keys.
178You can use the
179.Fl f
180option of the
181.Xr kbdcontrol 1
182utility to assign arbitrary strings to function keys.
183.It lshift
184Act as left shift key.
185.It rshift
186Act as right shift key.
187.It clock
188Act as caps lock key.
189.It nlock
190Act as num lock key.
191.It slock
192Act as scroll lock key.
193.It lalt|alt
194Act as left alt key.
195.It btab
196Act as backwards tab.
197.It lctrl|ctrl
198Act as left control key.
199.It rctrl
200Act as right control key.
201.It ralt
202Act as right alt (altgr) key.
203.It alock
204Act as alt lock key.
205.It ashift
206Act as alt shift key.
207.It meta
208Act as meta key.
209.It lshifta|shifta
210Act as left shift key / alt lock.
211.It rshifta
212Act as right shift key / alt lock.
213.It lctrla|ctrla
214Act as left ctrl key / alt lock.
215.It rctrla
216Act as right ctrl key / alt lock.
217.It lalta|alta
218Act as left alt key / alt lock.
219.It ralta
220Act as right alt key / alt lock.
221.It nscr
222Act as switch to next screen.
223.It pscr
224Act as switch to previous screen.
225.It scr Ns Ar N
226Switch to screen
227.Ar N ,
228where
229.Ar N
230is a decimal number.
231.It boot
232Reboot the machine.
233.It halt
234Halt the machine.
235.It pdwn
236Halt the machine
237and attempt to power it down.
238.It debug
239Call the debugger.
240.It susp
241Use APM to suspend power.
242.It saver
243Activate screen saver
244by toggling between splash/text screen.
245.It panic
246Panic the system.
247The
248.Xr sysctl 8
249variable
250.Va machdep.enable_panic_key
251must be set to 1 to enable this feature.
252.It paste
253Act as mouse buffer paste.
254.El
255.Pp
256Finally,
257to complete the description of a key,
258a flag which describes
259the effect of caps lock and num lock
260on that key is given.
261The flag can be
262.Ql C
263to indicate that caps lock affects the key,
264.Ql N
265to indicate that num lock affects the key,
266.Ql B
267to indicate that both
268caps lock and num lock affects the key,
269or
270.Ql O
271to indicate that neither affects the key.
272.Pp
273An accent key works
274by modifying the behavior
275of the next key pressed.
276The description of an accent begins
277with one of the accent names
278given above.
279This is followed
280by the symbol for the accent,
281given in single quotes or
282as a decimal or hexadecimal
283.Tn Unicode
284value.
285This symbol will be produced
286if the accent key is pressed and
287then the space key is pressed.
288.Pp
289The description of the accent key
290continues with a list showing
291how it modifies various symbols,
292by giving pairs made up of the normal symbol and
293the modified symbol
294enclosed in parentheses.
295Both symbols in a pair can be given
296in either single quotes or
297as decimal or
298hexadecimal
299.Tn Unicode
300values.
301.Pp
302For example,
303consider the following extract from a
304.Nm :
305.Bd -literal -offset indent
306  041   dgra   172    nop    nop    '|'    '|'    nop    nop     O
307  dgra  '`'  ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 )
308             ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 )
309             ( 'u' 249 ) ( 'U' 217 )
310.Ed
311This extract
312configures the backtick key on a UK keyboard
313to act as a grave accent key.
314Pressing backtick followed by space
315produces a backtick, and
316pressing a backtick followed by a vowel
317produces the ISO-8859-1 symbol
318for that vowel with a grave accent.
319.Sh FILES
320.Bl -tag -width /usr/share/syscons/keymaps/* -compact
321.It Pa /usr/share/syscons/keymaps/*
322standard keyboard map files for syscons
323.It Pa /usr/share/vt/keymaps/*
324standard keyboard map files for vt
325.El
326.Sh SEE ALSO
327.Xr kbdcontrol 1 ,
328.Xr kbdmap 1 ,
329.Xr keyboard 4 ,
330.Xr syscons 4 ,
331.Xr vt 4 ,
332.Xr ascii 7
333.Sh HISTORY
334This manual page first appeared in
335.Fx 4.2 .
336