mapkey, mapscrn, mapstr, convkey --
configure console keyboard, console screen, and console function key mapping
mapkey [ -adoqx ] [ mapfile ]
mapkey [ -ccsxmap ] [ mapfile ]
mapscrn [ -d ] [ mapfile ]
mapstr [ -d ] [ -f [ termtype ] ]
convkey [ old [ new ] ]
mapkey, mapscrn and mapstr configure
console keyboard mapping, console screen mapping, and the strings
associated with console function keys respectively.
root can map or unmap any console device, while other users
can map only the devices that they own.
mapkey, mapscrn and mapstr all understand
the following option:
Display an ASCII version on the standard output
of the mapping table read from the kernel.
The format of the output is suitable for
input files to mapscrn, mapkey,
mapkey sets keyboard mapping for the console multiscreens,
/dev/tty01 through /dev/tty12
if these are configured for use.
If mapfile is not specified or the -a
option is specified, mapkey uses the mapfiles defined for
each multicreen in the file /etc/default/mapkey.
mapkey understands the following options:
Set the keyboard mapping for the console multiscreens according to
the entries in /etc/default/mapkey.
Each line in this file names a multiscreen device and a
corresponding mapfile in the /usr/lib/keyboard directory.
For example, if you run mapkey -a with the
following entry set in /etc/default/mapkey,
the device /dev/tty01 is mapped using the file
If a file is not specified for a multiscreen device,
mapkey uses the file /usr/lib/keyboard/keys.
Convert mapfile to generate an
keyboard configuration file csxmap
for use by the
If mapfile is not
specified, mapkey converts the file
Display the mapping table in octal notation.
Suppress the display of error messages.
Display the mapping table in hexadecimal notation.
mapscrn sets screen mapping for the console
according to the file /usr/lib/console/screens
if mapfile is not specified.
mapstr understands the following option:
-f [ termtype ]
Specify the terminal type for setting function key strings.
mapstr reads the function key values from the file
and passes these values to
If termtype is not specified, mapstr takes
the terminal type from the TERM environment variable.
The default terminal type is ``ansi'' if TERM is not set.
If the -f option is not specified, mapstr
reads the function key string entries in /usr/lib/keyboard/strings.
The mapstr utility expects 12 function keys.
If your console keyboard uses a different number of function keys,
these keys might have unexpected effects when you
run your system console in scancode mode.
For example, function keys above <F12>
might behave like shifted function keys below <F12>
(that is, <Shift><F1>, <Shift><F2>, and so on).
convkey translates an old-style mapkey file,
old, into a file with the current format, new.
If the new file is specified, the old file must also
If old or new are not specified, convkey
reads the standard input or writes to the standard output respectively.
Console keyboard mapping
The keyboard of the console operates independently from the screen.
This is because of the way it generates the characters using scan-codes.
The keys of the system console are mapped using
mapkey, which applies only to the console and
allows you to configure your console to use keyboards other than
the standard US keyboard.
The function of mapkey is separate from that of
mapchan in that the console keyboard should generate
character codes in the form understood by the console display.
This is most often the PC 8-bit code set (IBM 437),
not the ISO 8859-1 8-bit code set.
mapkey files are supplied for various
PC-AT and PS/2 style keyboards. The
keyboard file that should be used is also influenced by the
character set used by the console screen. All the keyboard
files can be found in the /usr/lib/keyboard
directory and are listed in
``Console mapkey files''.
The mapkey files map the console keyboard to meet
the given national standard. The mapkey file for
a particular national standard may need to be modified for
a specific keyboard. If you want to change the key map,
link or copy the mapkey file appropriate for your
keyboard to the file /usr/lib/keyboard/keys, so
that it is accessed when mapkey is called with no
Console mapkey files
The following mapkey files in the directory
/usr/lib/keyboard are supplied for PS/2 and
PC-AT style keyboards and different character sets.
ROM or vidi(C) font
* Press the <Alt> key to emulate PC-AT style keyboard.
ROM or vidi(C) font
Note that the layout of different manufacturers' keyboards can vary,
so some changes may be necessary to these files for
correct operation on your system.
There is no way to specify that the map utilities read their
configuration tables from standard input.
If mapkey -a is run but the correct tty line cannot be found
in /etc/default/mapkey, mapkey reads the default
Likewise, if no key file is specified against the appropriate tty
entry in /etc/default/mapkey, mapkey -a uses
/usr/lib/keyboard/keys. When the user logs
off, getty will reset any keyboard mappings
on that line unless MAPKEY=YES is added
to /etc/default/boot. When this change is
made, getty also reads /etc/default/mapkey at login time,
to obtain the mapkey file to use with each tty.