ITEM: AG4046L

How to read terminfo Fkey values from c program.



Question:

problem with terminfo/after installing 3.2.5 
function keys f11-f24 don't return value from call tgetstr
 Customer is actually trying to use a termcap function
tgetstr to return the string for the function keys.
BSD 4.3 defines only 10 function keys, and I think that
might be the problem here.  Ref: O'Rielly, "Termcap and
Terminfo", p 4.3.

Customer would like to know the AIX equivalent of these
commands.

The terminfo equivlent is tigetstr, but this is not supported
by AIX 3.2.5.  This is supported under AIX 4.1

At 3.2.5, one possibility would be to use the setupterm call,
which initializes the cur_term global variable which is set to
point to the current structure of terminfo capabilities.  The
position in the structure is defined in term.h. 
The key appears to be in the term.h
structure.  

Example program:

/* This program puts out the string specified
in the printf statement.  In this example it
is function key 12.  See the /usr/include/term.h
for the names to use */

\#include \

main (argc,argv)
char **argv;
{        int err;
        int xcode;
        char cap[40];
                setupterm(0,1,&err);
        printf ("This is it %s\\n",key_f12);
        exit (0);
}cc -o tisee -l cur tisee.c
tisee | od -c


Support Line: How to read terminfo Fkey values from c program. ITEM: AG4046L
Dated: March 1995 Category: N/A
This HTML file was generated 99/06/24~13:30:28
Comments or suggestions? Contact us