Need help on how to set function keys on terminals
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi, I am new to informix 4GL. I have been assigned to write a small 4GL program. I have written a program that expect user's input from function keys using ON KEY command. The program works fine from the main console but when the same program running from a terminal (VT100). The ON KEY doesn't work. It doesn't recognize the function key pressed from the terminals. I have read the manuals and I couldn't find any references about function keys in conjunction with terminal emulation. Could anyone help me what I should do to make the program work on both the main console and terminals? Thank you for your help. Kent Chiu kchiu@iname.com
If your 4GL works on the console then the problem is not the program. The problem is either the TERMCAP/TERMINFO definitions for the terminal, the terminal emulation, or the terminal has set the VT100 into Application Mode which generates different key codes for the function and keypad keys than Terminal Mode. Add the VT100 codes to set the terminal into Terminal Mode in the TERMCAP entry's init string. When 4GL starts up curses it sends the terminal init string and this is what can set the keypad into a known state. Actually either Application or Terminal mode is fine it is just that the keycodes in the function key mappings, k1...kn, must match whatever mode the keypad and function keys are set into. So check which mode the init string is setting the terminal into, pick one if none, and make the key mappings match. Probably your console and terminals have different default and the init string does not set the mode. Art S. Kagel Kent Chiu wrote: > > Hi, > > I am new to informix 4GL. I have been assigned to write a small 4GL > program. > > I have written a program that expect user's input from function keys > using ON KEY command. > > The program works fine from the main console but when the same > program running from a terminal (VT100). The ON KEY doesn't > work. It doesn't recognize the function key pressed from the > terminals. > > I have read the manuals and I couldn't find any references about > function keys in conjunction with terminal emulation. > > Could anyone help me what I should do to make the program > work on both the main console and terminals? > > Thank you for your help. > > Kent Chiu > kchiu@iname.com