next up previous contents index
Next: The setcase Command Up: User Interface Setup Commands Previous: User Interface Setup Commands   Contents   Index


The mapkey Command

The mapkey command provides limited keyboard mapping support.

mapkey [ -r [filename] | -w [filename] | keyname data ]
Only the keys that are used for command line editing are mappable. This is to account for ``strange'' terminals that may not send the expected data when a key is pressed.

The following keys can be mapped:

Ctrl-A
Ctrl-D
Ctrl-E
Ctrl-K
Ctrl-U
Ctrl-V
Tab
Backspace
Delete
LeftArrow
RightArrow
UpArrow
DownArrow
Of these, the arrow keys and Delete are most likely to need remapping.

If no argument is given, the user is prompted to press each of these keys, and the internal map is updated. After doing this, the keys should have their expected effect when pressed while entering a WRspice command.

If ``-w [filename]'' is given, the present internal map will be saved in the named file, or ``wrs_keymap'' in the current directory if no filename is given.

If ``-r [filename]'' is given, the file will be read as a key mapping file, and the internal map will be updated. The filename, if not given, defaults to ``wrs_keymap''. If no path is given, it will be found in the current directory or the startup directory.

If ``keyname data...'' is given, a single key in the internal map can be updated. The format is the same as the entries in the mapping file, i.e., one of the names above, followed by one or more hex bytes of data. The bytes represent the stream sent when the named key is pressed, and will henceforth be interpreted as the pressing of that key. The bytes should be in hex format, and the first byte of a multi-byte sequence must be the Escape character (1b).

Example (from real life):

After installing the latest X-window system, suppose one finds that, when running WRspice in an xterm window, the Delete key no longer deletes the character under the cursor in WRspice, but instead injects some gibberish. There are three ways to fix this. The first two are specific to the xterm program, and instruct the xterm to send the ASCII Del character when Delete is pressed, rather than use the new default which is to send the VT-100 ``delete character'' string. The third method is to map this string into the delete function in WRspice.

  1. From the main xterm menu, find and click on the ``Delete is DEL'' entry. Usually, holding the Ctrl key and clicking in the xterm with button 1 displays this menu.

  2. Create a file named ``XTerm'' in your home directory, containing the line
    *deleteIsDEL: true

  3. In WRspice, type ``mapkey'' and follow the prompts. You can save the new map, and add a line to a .wrspiceinit startup file to read it when WRspice starts.


next up previous contents index
Next: The setcase Command Up: User Interface Setup Commands Previous: User Interface Setup Commands   Contents   Index
Stephen R. Whiteley 2022-09-18