mapchan(4) mapchan(4)
NAME
mapchan - format of terminal mapping files
DESCRIPTION
The mapchan mechanism supports the mapping of characters input and
output on terminals. On the input side, single characters can be
mapped to other characters (1-to-1 mapping), and compose and dead key
sequences can be defined. On the output side, single characters can be
mapped to one or more characters (1-to-N mapping).
A (non-empty) mapchan map file is in a number of sections, each sec-
tion beginning with a line containing the appropriate keyword.
The "input" section describes the mapping rule for input characters.
Every non-empty line in this section must consist of a pair of charac-
ter values. The first value in the line designates the character which
is to be mapped to the second character value.
Example:
input # Mapping rule for input characters
'a' 'b' # Character 'a' is mapped to 'b'
The "output" section describes the mapping rule for output characters.
The first character value in each line is mapped to the character
string defined by the rest of the character values in that line.
Example:
output # Mapping rule for output characters
'a' 'm' 'n' 'o' # Character 'a' is mapped to string "mno"
The "compose" section of the map file defines compose key sequences.
The header line for this section consists of the keyword compose and
the character defined as the compose key: "compose character". The
lines in this section must contain three character values: the first
two form the second and third characters of the compose sequence, the
third is the character to which the compose sequence is mapped.
Example:
compose 'x' # Introduce compose sequences and define compose key 'x'
'a' 'b' 'm' # Compose sequence 'x' 'a' 'b' is mapped to character 'm'
Page 1 Reliant UNIX 5.44 Printed 11/98
mapchan(4) mapchan(4)
The "dead" sections of the map file define dead key sequences. Simi-
larly to the "compose" section, the header line for a "dead" section
consists of the keyword dead and the dead key: "dead character". The
lines in a "dead" section must consist of a pair of character values:
the first value is the second character of the dead key sequence, the
second is the character to which the dead key sequence is mapped.
There must be a separate "dead" section for each dead key.
Example:
dead 'y' # Define dead key sequences for dead key 'y'
'a' 'm' # Dead key sequence 'y' 'a' is mapped to character 'm'
A map file may also include a line containing the keyword beep. This
keyword causes an audible signal (BEL) to be emitted in the event of
invalid input (such as undefined dead or compose key sequences).
The hash character (#) is interpreted as a comment character. All
characters between the comment character and the end of the line will
be ignored.
A map file defined as empty consists of a single line containing the
keyword null. This keyword must not be combined with any other key-
words.
A non-empty map file must consist of at least an "input" section and
an "output" section, although these sections do not have to contain
mapping rules.
Input and output characters which map to themselves do not need to be
included in the map file.
The individual characters in a map file can be specified in various
ways. The following formats are accepted:
'b' a character in single quotes
98 character code in decimal
0142 character code in octal
0x62 character code in hexadecimal
'\142' octal character code in single quotes
'\x62' hexadecimal character code in single quotes
Page 2 Reliant UNIX 5.44 Printed 11/98
mapchan(4) mapchan(4)
The following control characters are also recognized:
'\n' newline character
'\t' tab
'\r' carriage return
'\b' backspace
Sample map file:
beep # Audible signal on error
input # Mapping rule for input characters
'.' ',' # Dot mapped to comma
dead '^' # Definition of ^ as dead key
' ' '^' # ^ followed by blank produces ^
'a' 0342 # ^ followed by a produces ISO 88591-1 character â
dead 047 # Definition of ' as dead key
' ' 047 # ' followed by blank produces '
'e' 0351 # ' followed by e produces ISO 88591-1 character é
compose 037 # Definition of character ^ (control underscore) as
# compose key
'c' ',' 0347 # The sequence ^ c , produces ISO 88591-1 character ç
output # Mapping rule for output characters
'&' 'u' 'n' 'd' # Character & is mapped to string "and" (1-to-N mapping)
Page 3 Reliant UNIX 5.44 Printed 11/98
mapchan(4) mapchan(4)
The mapchan map files by default reside in the /usr/lib/mapchan direc-
tory. The mapchan command performs the following error checks when
processing a map file:
- more than one compose key defined
- "input" or "output" section missing
- more than one "input" or "output" section
- 1-to-N mapping of input characters
- input characters mapped to the NIL character
- general syntax errors
NOTES
If an invalid mapping table is set on a terminal, it will generally no
longer be possible to work on that terminal.
Input characters are always subjected to 1-to-1 mapping, even if they
are part of a dead or compose key sequence.
Input characters must not be mapped to the NIL character (null byte);
but a dead or compose key sequence may generate a NIL character, and a
string to which an output character is mapped may include NIL charac-
ters.
No more than 255 dead and compose key sequences may be defined; and
all the strings in the output section must not contain more than 255
characters in total.
The ISTRIP flag [see stty(1)] should not be set for a terminal to
which a mapping table has been applied, as it causes the eighth bit to
be stripped.
For the system administrator:
Each terminal map file requires a 2048-byte buffer in the operating
system. If a number of terminals use the same map file, only one
buffer is required, as the terminals then share the buffer. There is a
limit on the number of buffers used for map files. The system adminis-
trator can configure this limit using the NEMAP system parameter [see
idtune(1M)].
FILES
/usr/lib/mapchan/*
SEE ALSO
stty(1), mapchan(1M), mapkey(1M), ascii(5), meta-ascii(5),
keyboard(7) [on RM400], tty(7).
Page 4 Reliant UNIX 5.44 Printed 11/98