PF/Function keys not working on UNIX/Linux



A program working fine on Windows OS, does not detect the Function keys  being pressed when running on UNIX/Linux platforms.  Modifying the a_termcap file does not provided the expected results when using PF/Function keys either.


This is a terminal emulator problem.  If the emulator does not send the appropiate character string to the operating system and the OS does not forward this information to the runtime, there is no way for the runtime to pass to the program which key was pressed.

The solution is to change the settings of the emulator to map the right character set and send the correct string to the program.

Testing a sample program with two different emulators each emulator needs to be changed to pass the correct escape seqence strings in a different way.  For example:

1) With the termincal emulation package CRT it is necesary to map the F5 through F12 keys.  By default the first 4 function keys are already mapped and to make F5 to work it is done by choosing Options/Emulation/Mapped Keys from the emulator menu bar, pressing the Map a Key button, clicking on F5 on the displayed keyboard and then setting the value "\eOT" in the Send String entry-field.  CRT will now send the expected escape sequence string to the OS which will pass it on to the runtime.

This type of modification would need to be done for the rest of the function keys as well (the value is different for each and should match the escape sequence defined in a_termcap for the appropriate key).

2)  With PuTTY on other hand on the Terminal/Keyboard window of the Change Settings menu, select the VT100 radio button of The Function keys and keypad option, doing this all the F's keys work.

Other terminal emulation packages (Reflections, etc.) will have different ways to change the key map settings, however once mapped to the correct escape character strings all should work well in working with the ACUCOBOL-GT runtime.

Old KB# 2713
Comment List