595 lines
18 KiB
HTML
595 lines
18 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of KEYMAPS</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>KEYMAPS</H1>
|
|
Section: File Formats (5)<BR>Updated: 24 April 1998<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
keymaps - keyboard table descriptions for loadkeys and dumpkeys
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
These files are used by
|
|
<B><A HREF="/cgi-bin/man/man2html?1+loadkeys">loadkeys</A></B>(1)
|
|
|
|
to modify the translation tables used by the kernel keyboard driver
|
|
and generated by
|
|
<B><A HREF="/cgi-bin/man/man2html?1+dumpkeys">dumpkeys</A></B>(1)
|
|
|
|
from those translation tables.
|
|
<P>
|
|
|
|
The format of these files is vaguely similar to the one accepted by
|
|
<B><A HREF="/cgi-bin/man/man2html?1+xmodmap">xmodmap</A></B>(1).
|
|
|
|
The file consists of charset or key or string definition lines
|
|
interspersed with comments.
|
|
<P>
|
|
|
|
Comments are introduced with
|
|
<B>!</B>
|
|
|
|
or
|
|
<B>#</B>
|
|
|
|
characters and continue to the end of the line. Anything following one
|
|
of these characters on that line is ignored. Note that comments need
|
|
not begin from column one as with
|
|
<B><A HREF="/cgi-bin/man/man2html?1+xmodmap">xmodmap</A></B>(1).
|
|
|
|
<P>
|
|
|
|
The syntax of keymap files is line oriented; a complete definition
|
|
must fit on a single logical line. Logical lines can, however, be split
|
|
into multiple physical lines by ending each subline with the backslash
|
|
character (\).
|
|
<A NAME="lbAD"> </A>
|
|
<H2>INCLUDE FILES</H2>
|
|
|
|
A keymap can include other keymaps using the syntax
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="1"><DD>
|
|
include "pathname"
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>CHARSET DEFINITIONS</H2>
|
|
|
|
A character set definition line is of the form:
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="2"><DD>
|
|
|
|
charset "iso-8859-x"
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
It defines how following keysyms are to be interpreted.
|
|
For example, in iso-8859-1 the symbol mu (or micro) has code 0265,
|
|
while in iso-8859-7 the letter mu has code 0354.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>COMPLETE KEYCODE DEFINITIONS</H2>
|
|
|
|
Each complete key definition line is of the form:
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="3"><DD>
|
|
<PRE>
|
|
<B>keycode</B><I> keynumber </I><B>=</B><I> keysym keysym keysym</I><B></B>...
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<I>keynumber</I>
|
|
|
|
is the internal identification number of the key, roughly equivalent to
|
|
the scan code of it.
|
|
<I>keynumber</I>
|
|
|
|
can be given in decimal, octal or hexadecimal notation.
|
|
Octal is denoted by a leading zero and hexadecimal by the prefix
|
|
<B>0x.</B>
|
|
|
|
<P>
|
|
|
|
Each of the
|
|
<I>keysyms</I>
|
|
|
|
represent keyboard actions, of which up to 256 can be bound to a single
|
|
key. The actions available include outputting character codes or
|
|
character sequences, switching consoles or keymaps, booting the machine
|
|
etc. (The complete list can be obtained from <A HREF="/cgi-bin/man/man2html?1+dumpkeys">dumpkeys</A>(1) by saying
|
|
<B> dumpkeys -l</B>
|
|
|
|
.)
|
|
<P>
|
|
|
|
Each
|
|
<I>keysym</I>
|
|
|
|
may be prefixed by a '+' (plus sign), in wich case this keysym is treated
|
|
as a "letter" and therefore affected by the "CapsLock" the same way as by
|
|
"Shift" (to be correct, the CapsLock inverts the Shift state).
|
|
The ASCII letters ('a'-'z' and 'A'-'Z') are made CapsLock'able by default.
|
|
If Shift+CapsLock should not produce a lower case symbol, put lines like
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="4"><DD>
|
|
<PRE>
|
|
<B>keycode 30 = +a A</B>
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
in the map file.
|
|
<P>
|
|
|
|
Which of the actions bound to a given key is taken when it is pressed
|
|
depends on what modifiers are in effect at that moment.
|
|
The keyboard driver supports 9 modifiers. These modifiers are labeled
|
|
(completely arbitrarily) Shift, AltGr, Control, Alt, ShiftL, ShiftR,
|
|
CtrlL, CtrlR and CapsShift.
|
|
Each of these modifiers has an associated weight of power of two
|
|
according to the following table:
|
|
<P>
|
|
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="5"><DD>
|
|
<DL COMPACT>
|
|
<DT id="6"><I>modifier</I>
|
|
|
|
<DD>
|
|
<I>weight</I>
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
|
|
|
|
Shift<TT> </TT>1<BR>
|
|
<BR>
|
|
|
|
AltGr<TT> </TT>2<BR>
|
|
<BR>
|
|
|
|
Control<TT> </TT>4<BR>
|
|
<BR>
|
|
|
|
Alt<TT> </TT>8<BR>
|
|
<BR>
|
|
|
|
ShiftL<TT> </TT>16<BR>
|
|
<BR>
|
|
|
|
ShiftR<TT> </TT>32<BR>
|
|
<BR>
|
|
|
|
CtrlL<TT> </TT>64<BR>
|
|
<BR>
|
|
|
|
CtrlR<TT> </TT>128<BR>
|
|
<BR>
|
|
|
|
CapsShift<TT> </TT>256<BR>
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
|
|
The effective action of a key is found out by adding up the weights of
|
|
all the modifiers in effect. By default, no modifiers are in effect, so
|
|
action number zero, i.e. the one in the first column in a key definition
|
|
line, is taken when the key is pressed or released. When e.g. Shift and
|
|
Alt modifiers are in effect, action number nine (from the 10th column)
|
|
is the effective one.
|
|
<P>
|
|
|
|
Changing the state of what modifiers are in effect can be achieved by
|
|
binding appropriate key actions to desired keys. For example, binding
|
|
the symbol Shift to a key sets the Shift modifier in effect when that
|
|
key is pressed and cancels the effect of that modifier when the key is
|
|
released. Binding AltGr_Lock to a key sets AltGr in effect when the key
|
|
is pressed and cancels the effect when the key is pressed again.
|
|
(By default Shift, AltGr, Control and Alt are bound to the keys that bear
|
|
a similar label; AltGr may denote the right Alt key.)
|
|
<P>
|
|
|
|
Note that you should be very careful when binding the modifier keys,
|
|
otherwise you can end up with an unusable keyboard mapping. If you for
|
|
example define a key to have Control in its first column and leave the
|
|
rest of the columns to be VoidSymbols, you're in trouble. This is
|
|
because pressing the key puts Control modifier in effect and the
|
|
following actions are looked up from the fifth column (see the table
|
|
above). So, when you release the key, the action from the fifth column
|
|
is taken. It has VoidSymbol in it, so nothing happens. This means that
|
|
the Control modifier is still in effect, although you have released the key.
|
|
Re-pressing and releasing the key has no effect. To avoid this,
|
|
you should always define all the columns to have the same modifier
|
|
symbol. There is a handy short-hand notation for this, see below.
|
|
<P>
|
|
|
|
<I>keysyms</I>
|
|
|
|
can be given in decimal, octal, hexadecimal, unicode or symbolic notation.
|
|
The numeric notations use the same format as with
|
|
<I>keynumber</I>.
|
|
|
|
Unicode notation is "U+" followed by four hexadecimal digits.
|
|
The symbolic notation resembles that used by
|
|
<B><A HREF="/cgi-bin/man/man2html?1+xmodmap">xmodmap</A></B>(1).
|
|
|
|
Notable differences are the number symbols. The numeric
|
|
symbols '0', ..., '9' of
|
|
<B><A HREF="/cgi-bin/man/man2html?1+xmodmap">xmodmap</A></B>(1)
|
|
|
|
are replaced with the corresponding words 'zero', 'one', ... 'nine' to
|
|
avoid confusion with the numeric notation.
|
|
<P>
|
|
|
|
It should be noted that using numeric notation for the
|
|
<I>keysyms</I>
|
|
|
|
is highly unportable as the key action numbers may vary from one kernel
|
|
version to another and the use of numeric notations is thus strongly
|
|
discouraged. They are intended to be used only when you know there is a
|
|
supported keyboard action in your kernel for which your current version
|
|
of
|
|
<B><A HREF="/cgi-bin/man/man2html?1+loadkeys">loadkeys</A></B>(1)
|
|
|
|
has no symbolic name.
|
|
<P>
|
|
|
|
There is a number of short-hand notations to add readability and reduce
|
|
typing work and the probability of typing-errors.
|
|
<P>
|
|
|
|
First of all, you can give a map specification line, of the form
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="7"><DD>
|
|
|
|
keymaps 0-2,4-5,8,12
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
to indicate that the lines of the keymap will not specify all 256 columns,
|
|
but only the indicated ones. (In the example: only the plain, Shift,
|
|
AltGr, Control, Control+Shift, Alt and Control+Alt maps, that is, 7 columns
|
|
instead of 256.)
|
|
When no such line is given, the keymaps 0-M will be defined, where
|
|
M+1 is the maximum number of entries found in any definition line.
|
|
<P>
|
|
|
|
Next, you can leave off any trailing VoidSymbol entries from a key
|
|
definition line. VoidSymbol denotes a keyboard action which produces no
|
|
output and has no other effects either. For example, to define key
|
|
number 30 to output 'a' unshifted, 'A' when pressed with Shift and do
|
|
nothing when pressed with AltGr or other modifiers, you can write
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="8"><DD>
|
|
<PRE>
|
|
keycode 30 = a A
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
instead of the more verbose
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="9"><DD>
|
|
<PRE>
|
|
keycode 30 = a AVoidSymbolVoidSymbol \
|
|
VoidSymbol VoidSymbol VoidSymbol ...
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
For added convenience, you can usually get off with still more terse
|
|
definitions. If you enter a key definition line with only and exactly
|
|
one action code after the equals sign, it has a special meaning. If the
|
|
code (numeric or symbolic) is not an ASCII letter, it means the code
|
|
is implicitly replicated through all columns being defined.
|
|
If, on the other hand, the action code is an ASCII character in the
|
|
range 'a', ..., 'z' or 'A', ..., 'Z' in the ASCII collating sequence,
|
|
the following definitions are made for the different modifier combinations,
|
|
provided these are actually being defined.
|
|
(The table lists the two possible cases:
|
|
either the single action code is a lower case letter,
|
|
denoted by 'x' or an upper case letter, denoted by 'Y'.)
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="10"><DD>
|
|
<DL COMPACT>
|
|
<DT id="11"><I>modifier</I>
|
|
|
|
<DD>
|
|
<I>symbol</I>
|
|
|
|
<DT id="12">none<DD>
|
|
x<TT> </TT>Y<BR>
|
|
|
|
<DT id="13">Shift<DD>
|
|
X<TT> </TT>y<BR>
|
|
<DT id="14">AltGr<DD>
|
|
x<TT> </TT>Y<BR>
|
|
<DT id="15">Shift+AltGr<DD>
|
|
X<TT> </TT>y<BR>
|
|
<DT id="16">Control<DD>
|
|
Control_x<TT> </TT>Control_y<BR>
|
|
<DT id="17">Shift+Control<DD>
|
|
Control_x<TT> </TT>Control_y<BR>
|
|
<DT id="18">AltGr+Control<DD>
|
|
Control_x<TT> </TT>Control_y<BR>
|
|
<DT id="19">Shift+AltGr+Control<DD>
|
|
Control_x<TT> </TT>Control_y<BR>
|
|
<DT id="20">Alt<DD>
|
|
Meta_x<TT> </TT>Meta_Y<BR>
|
|
<DT id="21">Shift+Alt<DD>
|
|
Meta_X<TT> </TT>Meta_y<BR>
|
|
<DT id="22">AltGr+Alt<DD>
|
|
Meta_x<TT> </TT>Meta_Y<BR>
|
|
<DT id="23">Shift+AltGr+Alt<DD>
|
|
Meta_X<TT> </TT>Meta_y<BR>
|
|
<DT id="24">Control+Alt<DD>
|
|
Meta_Control_x<TT> </TT>Meta_Control_y<BR>
|
|
<DT id="25">Shift+Control+Alt<DD>
|
|
Meta_Control_x<TT> </TT>Meta_Control_y<BR>
|
|
<DT id="26">AltGr+Control+Alt<DD>
|
|
Meta_Control_x<TT> </TT>Meta_Control_y<BR>
|
|
<DT id="27">Shift+AltGr+Control+Alt<DD>
|
|
Meta_Control_x<TT> </TT>Meta_Control_y<BR>
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SINGLE MODIFIER DEFINITIONS</H2>
|
|
|
|
All the previous forms of key definition lines always define all the M+1
|
|
possible modifier combinations being defined, whether the line actually
|
|
contains that many action codes or not.
|
|
There is, however, a variation of the definition
|
|
syntax for defining only single actions to a particular modifier
|
|
combination of a key. This is especially useful, if you load a keymap
|
|
which doesn't match your needs in only some modifier combinations, like
|
|
AltGr+function keys. You can then make a small local file redefining
|
|
only those modifier combinations and loading it after the main file.
|
|
The syntax of this form is:
|
|
<P>
|
|
|
|
<B></B>{<B> plain </B>| <modifier sequence> } <B>keycode</B>
|
|
|
|
<I>keynumber</I>
|
|
|
|
<B>=</B>
|
|
|
|
<I>keysym</I>
|
|
|
|
<P>
|
|
|
|
, e.g.,
|
|
<DL COMPACT><DT id="28"><DD>
|
|
|
|
<PRE>
|
|
plain keycode 14 = BackSpace
|
|
control alt keycode 83 = Boot
|
|
alt keycode 105 = Decr_Console
|
|
alt keycode 106 = Incr_Console
|
|
</PRE>
|
|
|
|
|
|
</DL>
|
|
|
|
Using "plain" will define only the base entry of a
|
|
key (i.e. the one with no modifiers in effect) without affecting the
|
|
bindings of other modifier combinations of that key.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>STRING DEFINITIONS</H2>
|
|
|
|
In addition to comments and key definition lines, a keymap can
|
|
contain string definitions. These are used to define what each function
|
|
key action code sends. The syntax of string definitions is:
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="29"><DD>
|
|
<B>string</B>
|
|
|
|
<I>keysym</I>
|
|
|
|
<B>=</B>
|
|
|
|
|
|
"text"
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<I>text</I>
|
|
|
|
can contain literal characters, octal character codes in the format of
|
|
backslash followed by up to three octal digits, and the three escape
|
|
sequences <B>\n</B>, <B>\\</B>, and <B>\"</B>,
|
|
for newline, backslash and quote, respectively.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>COMPOSE DEFINITIONS</H2>
|
|
|
|
Then there may also be compose definitions. They have syntax
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="30"><DD>
|
|
<B>compose '</B><I>char</I><B>' '</B><I>char</I><B>' to '</B><I>char</I><B>'</B>
|
|
|
|
</DL>
|
|
|
|
and describe how two bytes are combined to form a third one
|
|
(when a dead accent or compose key is used).
|
|
This is used to get accented letters and the like on a standard
|
|
keyboard.
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>ABBREVIATIONS</H2>
|
|
|
|
Various abbreviations can be used with kbd-0.96 and later.
|
|
<DL COMPACT>
|
|
<DT id="31"><B>strings as usual</B>
|
|
|
|
<DD>
|
|
Defines the usual values of the strings (but not the keys
|
|
they are bound to).
|
|
<DT id="32"><B>compose as usual for "iso-8859-1"</B><DD>
|
|
Defines the usual compose combinations.
|
|
</DL>
|
|
<P>
|
|
|
|
To find out what
|
|
<I>keysyms</I>
|
|
|
|
there are available for use in keymaps, use the command
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="33"><DD>
|
|
<PRE>
|
|
<B>dumpkeys --long-info</B>
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
Unfortunately, there is currently no description of what each symbol
|
|
does. It has to be guessed from the name or figured out from the kernel
|
|
sources.
|
|
<P>
|
|
|
|
<A NAME="lbAK"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
(Be careful to use a keymaps line, like the first line of `dumpkeys`,
|
|
or "keymaps 0-15" or so.)
|
|
<P>
|
|
|
|
The following entry exchanges the left Control key and the Caps Lock
|
|
key on the keyboard:
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="34"><DD>
|
|
<PRE>
|
|
keycode 58 = Control
|
|
keycode 29 = Caps_Lock
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
Key number 58 is normally the Caps Lock key, and key number 29 is
|
|
normally the Control key.
|
|
<P>
|
|
|
|
The following entry sets the Shift and Caps Lock keys to behave more
|
|
nicely, like in older typewriters. That is, pressing Caps Lock key once
|
|
or more sets the keyboard in CapsLock state and pressing either of the
|
|
Shift keys releases it.
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="35"><DD>
|
|
<PRE>
|
|
keycode 42 = Uncaps_Shift
|
|
keycode 54 = Uncaps_Shift
|
|
keycode 58 = Caps_On
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
The following entry sets the layout of the edit pad in the enhanced
|
|
keyboard to be more like that in the VT200 series terminals:
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="36"><DD>
|
|
<PRE>
|
|
keycode 102 = Insert
|
|
keycode 104 = Remove
|
|
keycode 107 = Prior
|
|
shift keycode 107 = Scroll_Backward
|
|
keycode 110 = Find
|
|
keycode 111 = Select
|
|
control alt keycode 111 = Boot
|
|
control altgr keycode 111 = Boot
|
|
</PRE>
|
|
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
Here's an example to bind the string "du\ndf\n" to the key AltGr-D. We use
|
|
the "spare" action code F100 not normally bound to any key.
|
|
<P>
|
|
|
|
<DL COMPACT><DT id="37"><DD>
|
|
<PRE>
|
|
altgr keycode 32 = F100
|
|
string F100 = "du\ndf\n"
|
|
|
|
</DL>
|
|
</PRE><A NAME="lbAL"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+loadkeys">loadkeys</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+dumpkeys">dumpkeys</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+showkey">showkey</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+xmodmap">xmodmap</A></B>(1)
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="38"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="39"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DT id="40"><A HREF="#lbAD">INCLUDE FILES</A><DD>
|
|
<DT id="41"><A HREF="#lbAE">CHARSET DEFINITIONS</A><DD>
|
|
<DT id="42"><A HREF="#lbAF">COMPLETE KEYCODE DEFINITIONS</A><DD>
|
|
<DT id="43"><A HREF="#lbAG">SINGLE MODIFIER DEFINITIONS</A><DD>
|
|
<DT id="44"><A HREF="#lbAH">STRING DEFINITIONS</A><DD>
|
|
<DT id="45"><A HREF="#lbAI">COMPOSE DEFINITIONS</A><DD>
|
|
<DT id="46"><A HREF="#lbAJ">ABBREVIATIONS</A><DD>
|
|
<DT id="47"><A HREF="#lbAK">EXAMPLES</A><DD>
|
|
<DT id="48"><A HREF="#lbAL">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:03 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|