Keymapping Setup

KoalaTerm had been designed as an emulator to VT series terminals. F1-F5 keys in KoalaTerm therefore are mapped to F1-F5 keys on VT keyboard by default. However, F1-F5 keys on VT keyboard are "local function keys" for VT terminal, like hold screen, print screen, etc. Those functions are not suitable or replaced by menu or toolbar commands in Windows environment. So, by default, F1-F5 keys on PC keyboard do nothing (that means, they don't generate any character sequences to host) in KoalaTerm emulator.

However, you may re map the F1-F5 keys to let them generate specific character sequences in order to emulate function keys for other type of terminals like various UNIX console. To find how to map a PC function key to specific sequence, please refer to our online help material, in Terminal Settings : Key Map section.

The key issue is to find what sequences F1-F5 should be mapped to. It depends on your operating system and your host application. Midasoft provide a small program which will help you to find all the sequences.

The following is the procedure:

1. Clip and paste the following program into your host system. (You may also download it from ftp://ftp.Midasoft.com/util/keycode.c.)

main()

{

char str[32];

int i;

printf("Please press the key you want to be mapped to, then press return key.\n");

printf("This program will then show you the sequence you should input into ");

printf("KoalaTerm keymapping.\n");

gets(str);

printf("The sequence should be: ");

for (i = 0; i < strlen(str); i ++) {

char ch = str[i];

if (ch == 0x1b) printf("");

else if (ch == 0x9b) printf("");

else if (ch < 0x20) printf("\\x%02X", ch);

else if (ch > 0x7e) printf("\\x%02X", ch);

else printf("%c", ch);

}

printf("\n");

}

2. Compile this file, then run it on your existing terminal emulator or console (on which the F1-F5 keys work with your host application), press a key you want to map, press return key, the program then will show you exactly the sequence you should input to KoalaTerm keymapping. Run this program once for each key.

3. Run KoalaTerm, using Keymap page on Settings dialog, set F1-F5 key mapping to those sequences. (For detailed procedure, see online help.)

Q: I understand how to map a key to sequence. But, the problem is that I don't know what sequence I should map to. How can I find out the sequence for keys on my system?

A: If you want to map a key to some function key which is not a VT keyboard key, and you don't know exactly what the control sequence is, you may need to do some experiment to find it out. If you have another terminal emulator which works with your keyboard and UNIX host, you may:

1. Download a mini program to your UNIX host from

ftp://ftp.Midasoft.com/util/keycode.c.

2. Use C compiler to compile keycode.c.

3. With the terminal emulator which keys work properly, run the compiled program.

4. 4. Follow the program, and you will find out what you should type in Key Map page of KoalaTerm Settings dialog.

Q: The cursor and keypad keys don't work with my host application.

A: The keypad mode or cursor key mode may not be correct. You may go to Keyboard page of Settings dialog and try to change those two modes.

Or, the terminal mode for control characters (7-bit/8-bit) may not be correct. Go to Terminal page of Settings dialog to change it.

Q: I got a session file which includes all my key mappings, and I want to use those mappings in another session, how do I do that?

A: There is another way to reuse your key mapping instead of copying the session file. First, copy the session file with your key mapping to the directory where mkt.EXE resides. In new session, go to Key Map page of Settings dialog, there is a "Use Template" drop-down list box, your will see a line like "Template: " in the list, select it, and all the key mapping information will be read into current session. You may then save current session.


Go to Index Page