Re: key stroke in 4gl
Posted in 1997
>Date: Fri, 15 Aug 1997 11:06:26 -0500
>From: Chengteh Lee <acustaf!clee@acustaf.acustaf.com>
>X-Informix-List-Id: <list.15979>
>
>Hi:
>
>I am very new in Informix 4GL, so I need help.
>The key strokes, such as F1, F2... keys in our GUI
>are working properly. However, when we installed it in other
>systems, it can not work.
>Should I look into the termcap settings in the informix 4gl, and
>how? Thanks!
Yes, you'll need to look into it. There are several things you'll have to do.
(1) You need to know the character codes generated by each of the function
keys. One relatively simple way to do that is to run 'od -c' and then
hit each function key in turn, separating each function key with a
return. When you're done, type ^D (or your EOF character) and you get
output such as:
$ od -c
^[[224z
^[[225z
^[[226z
0000000 033 [ 2 2 4 z \\n 033 [ 2 2 5 z \\n 033 [
^[[227z
^[[228z
0000020 2 2 6 z \\n 033 [ 2 2 7 z \\n 033 [ 2 2
^[[229z
^[[230z
0000040 8 z \\n 033 [ 2 2 9 z \\n 033 [ 2 3 0 z
^[[231z
^[[232z
^[[233z0000060 \\n 033 [ 2 3 1 z \\n 033 [ 2 3 2 z \\n 033
^[[234z
^[[235z
0000100 [ 2 3 3 z \\n 033 [ 2 3 4 z \\n 033 [ 2
0000120 3 5 z \\n
0000124
$
This was for keys F1..F12 on a Sun... The 033 is an escape (\\E in
termcap), the \\n is the return. The leading 0000000 etc is an octal offset
into the 'file' that is being typed. So the F1 key emits '\\E[224z'.
(2) You need to determine which termcap entry you are going to use. This
will probably be the same name as you currently use for $TERM, but it
might not be. You also need to establish which TERMCAP file you are
going to use.
(3) You then inspect the entry in the termcap file, along with the appendix
in the I4GL manuals on termcap, etc. You determine that I4GL's F1 key
corresponds to the k0 termcap entry (I think that's correct; I've not
checked recently), and you ensure that the keystrokes in the entry
match those generated by the function key, fixing it if not. I'd
normally make a local file which contained just the relevant termcap
entry, and set TERMCAP=`pwd`/termcap to simplify testing without
breaking anybody else's terminal.
(4) You test the revised termcap file on your I4GL applications. When it
is all working, you can decide how to get the termcap entry installed
for everyone who needs it.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
PS: Warning I do not reply to messages with anti-spam in the return path.