a question about using curses lib

Klaas Hemstra hst at mhres.mh.nl
Tue Feb 23 19:13:29 AEST 1988


You have to use cbreak() or raw(). Only then every character is
available to the program immediately after it is typed.

Function keys should be defined in the terminfo (or termcap on BSD) library.
If your terminfo file is ok (most likely it is not!) then the curses package
will decode the escape sequences for you if you use the keypad(stdscr,1) call.
In the program you use e.g.  :   if (getch() = KEY_F(1)   to test for a 
function key (check the curses manual for all keys).

Using function keys together with the numeric keypad is not that simple.
If you want that you should not specify the rmkx & smkx entries in the terminfo
file.

Hope this will help,

-- 
Klaas Hemstra  (hst at mh.nl)                   |    /  / ,~~~  ~~/~~
uucp: ..{uunet!}mcvax!mh.nl!jv               |   /--/  `-,    /  ___  |_/ |__|
Multihouse N.V., Gouda, the Netherlands      |  /  / ___/    /   ---  | \ |  | 



More information about the Comp.unix.questions mailing list