KoalaTerm provides a very powerful key mapping feature allowing you to map virtually any key on PC keyboard and combination with modifiers (CTRL, SHIFT and ALT) to VT standard keys, code sequences or KoalaTerm menu items.
How to Map a Key |
Here are detailed step-by-step instructions on mapping a key (or key combination with modifiers):
1. Click on the key you want to map in the graphic keyboard,
2. Select any modifiers (Ctrl, Shift, or Alt) by click on check boxes under the graphic keyboard,
3. The name of the key (or key combination) will be shown in the "Key Name" edit box. Make sure it's what you want,
4. Select mapping type and input mapping:
5. You must click "Set" button to finish the mapping. You can then repeat all the steps for mapping other keys.
Use Key Mapping Templates |
Key mapping templates include preset key mappings and mappings from KoalaTerm templates. Right now KoalaTerm provides following preset mapping templates:
To use a key mapping template, select it from the "Use Template" drop box. Warning: some of your previous key mapping may be overwritten by the template. Make sure your special mappings still exist by using the same procedure described above for mapping a key.
Sequence Syntax |
KoalaTerm only accepts displayable ASCII characters when you input a character sequence, so you need special ways to input special characters in the sequence, like "Control-C", "Carriage Return" or "Escape", etc. You have some different ways to input a special character:
1. For any special characters, if you know the numeric code (most likely a ASCII code) for it, you can use that code to input the character. The format is "\xnn". Where "nn" is the two digit hexadecimal code. Each digit could be 0-9, A-F or a-f. You must provide two digits, including the prefix '0' for single digit codes. For example, the ASCII code for Control-C character is 3, so you can put a "\x03" (Note: double quote mark not included) in the sequence for a Control-C.
2. For special characters which can be generated by pressing a letter key while holding the "Control" key, there is a simpler way to specify the special character, use format "^C", where "C" is the letter (must be uppercase). For example, again Control-C, can be represented simply by "^C".
3. For certain special characters, a more easy-to-read way can be used. These include: "<ESC>" for "Escape", "<CR>" or "Carriage Return", "<LF>" for "Line Feed", and "<CSI>" for 8-bit form of "Escape [". Note: all letters are uppercase.
Important: to input literal "\", "<" and "^", put a "\" before them, i.e. "\\", "\<", "\^". Otherwise they may be treated as introducer of special characters.
How Do I Know What Sequence I Should Map to |
Suppose you have a host running an application or operating system which requires special keys but can't get it from standard KoalaTerm settings, you need to use key mapping to map keys to those sequences the host or application is expecting. There are several ways to figure out what sequence you should map to:
First, if you have document for your host or application, you can look at it and try to find the sequences for special keys.
If you have some other terminal or terminal emulator working with your host application, you can use a little program running on the host to detect what sequence the terminal (or emulator) is sending to the host. The small program can be downloaded from here. You should compile this C language program on your host, and run it with one of the terminal (or emulator) which is generating the correct key codes.
For Unix system, there is a "termcap" file indicating what kind of sequences expected for special keys. It's typicially located in "/etc" directory. It includes entries for different types of terminal. You need to find the the entry for the terminal type your application uses. You can check the "term" environment variable for terminal type currently being used. Some applications only support particular types of terminal. From manual page about "termcap", you can get format of this file.