keycomp Command

Purpose

Compiles a keyboard mapping file into an input method keymap file.

Syntax

keycomp <Infile >Outfile

Description

The keycomp command reads a textual description of the keyboard from standard input and produces a binary file that maps the keys to standard output. The binary file is used by the Input Method to translate key strokes into character strings.

You can bind characters and strings to keys on a keyboard with specified combinations of modifier keys called keyboard states, or you can specify particular key and state combinations as unbound (return nothing). All input keys are represented by keysyms, which stand for the key symbols that are usually used in the AIXwindows environment to represent keyboard input.

Any combination of modifier keys is possible when you press a key on the keyboard, but usually the keys are mapped into a smaller set of states. This state mapping can be specified.

Keycomp Source File

The input file used by the keycomp command consists of one or more lines. The items on the line are separated by a space. Each line begins with a keysym or a hexadecimal value for a keysym. The hexadecimal value represents keyboard input in the AIXwindows environment. Items following the keysym represent the binding for a particular combination of the Ctrl, Alt, Shift, Lock, and Alt Graphic keys.

An item can be one of the following:

Hexadecimal ( \xXX), octal ( \oOOO), and decimal ( \dDDD) notations of a byte can be contained in character and string items.

Keyboard States

Modifier keys (Shift, Lock, Ctrl, Alt, and Alt Graphics keys) change the state of the keyboard. They are used to select one item from a line corresponding to the input keysym. A value that is a combination of bits, each bit corresponding to a modifier key, indicates the state of a keyboard. The modifier keys increase in significance in the following order: Shift, Lock, Ctrl, Alt, and Alt Graphic modifier keys.

The bit combination or state value of a keyboard is mapped to one item of a line. The mapping is defined by the line beginning with the %M control, which can contain only numbers. The first number after the %M control is the item number. The numbers that follow the first number represent keyboard states, and they are all mapped to the item. See Examples.

Flags

Item Description
<InFile Specifies a source file to be compiled by the keycomp command.
>OutFile Specifies the name of the keymap file to be created.

Examples

  1. The following is an example of a line for XK_a keysym input:
    XK_a'a'  XK_A  XK_A  XK_a  '\x01'  U  "hello"

    A , (comma) can, but need not, follow each item. Regardless of whether a comma follows an item, a space or tab must separate the items.

    Blank lines and lines beginning with the # character, except control statements, are ignored. All text between the # and the following line is ignored unless the # is part of a string enclosed in single or double quotation marks. Therefore, you can place comments at the end of a line that contains only a single item.

  2. The following line shows that the keyboard states Ctrl, Ctrl+Shift, and Ctrl+Shift+Lock are all mapped to the third item:
    %M 3      4 5 7

Files

Item Description
/usr/include/x11/keysymdef.h Contains standard keysym definitions.
/usr/include/x11/aix_keysym.h Contains unique keysym definitions.
/usr/bin/keycomp Contains the keycomp command.
/usr/lib/nls/loc/*.imkeymap.src Contains imkeymap source information.
/usr/lib/nls/loc/*.imkeymap Maps a keysym/modifier to a string.