> I need a quick test for reading the function keys of an emulator running on a
> PC TERM is either vt340 or wyse60 or some other vt or wyse variant. I need
> see if the function key is being passed in F1-F20 at least F1-F24 ideally.
> Can someone point me to some code examples of reading function keys in C,
> Perl, or anything so that I can test if the problem lies in the operating
> system a third party software. Thanks in advance. Ray Kinney
int key;
int main (void)
{
initscr ();
atexit (endwin);
cbreak ();
noecho ();
keypad (stdscr, TRUE);
while (1)
{
clear ();
key = getch ();
if (key == 4) exit (EXIT_SUCCESS);
mvaddstr (0, 0, keyname (key));
refresh ();
The endless loop will wait for a key to be hit, and then display the keynameQuote:}
}
on the screen top. ctrl-d will terminate the endless loop (and the whole
program).
Klaus Schilling