next up previous contents index
Next: Key Mapping File Up: The Attributes Menu: Set Previous: The Save Tech Button:   Contents   Index


The Key Map Button: Create Key Mapping File

Several of the keys which Xic uses are not found on all keyboards, or they may return a different code than Xic expects. Xic contains a built-in facility for remapping keys from the keyboard to the functions expected in Xic, through the Key Map button in the Attributes Menu. The user is prompted to press keys on the keyboard that will correspond to the various special keys such as Page Up, Page Down, Home, and numeric keypad Add and Subtract. Only special function keys can be remapped, not the standard character entry keys, or modifier keys (e.g., Shift, Control) and not the function keys 1-12. If there is no response when a key is pressed and the pointer is in a drawing window, then that key can not be mapped. To skip mapping of a key, press Enter. To abort, press Esc. When the prompting is finished, a file will be created in the current directory named xic_keymap by default. The user is given the option to alter this name.

The file can be moved to a safe place if desired. The keyboard mapping is not actually performed until this file is read by Xic, which must be done explicitly. This differs from Xic releases earlier than 4.0.0, which attempted to automatically read a created mapping file. There are two ways to accomplish reading the mapping file:

  1. The !kmap command: !kmap mapfile
    This command can be typed into the prompt line and will cause the named file to be read and the mapping asserted immediately.

  2. The ReadKeymap script function: ReadKeymap(mapfile)
    The function can be run from any script. In particular, this line can be added to a startup script (.xicstart or .xicinit file) to assert the mapping when Xic starts.

In either case, the mapfile is a path to a file as created with this command. If the path is not rooted, the file is searched for relative to the current directory, the user's home directory, and through the library search path, in that order. The commands can be re-run with different mapping files at any time, the current mapping state reflects the most recent mapping applied.



Subsections
next up previous contents index
Next: Key Mapping File Up: The Attributes Menu: Set Previous: The Save Tech Button:   Contents   Index
Stephen R. Whiteley 2024-09-29