Trouble with Curses

Chris Torek chris at mimsy.umd.edu
Thu Nov 15 23:33:35 AEST 1990


In article <1990Nov14.061635.6183 at sysint.uucp> duncan at sysint.uucp
(Duncan MacGregor) writes:
>... characters read through the curses library disappeared after
>an ESC (escape, octal 033) character was read. ...
>    The problem lies not in curses but (I believe) in termcap.  I know the
>problem exists in "terminfo", which is the replacement for termcap in System V
>Rel. 2 and all descendant systems;  I believe it was inherited (or should I
>say inherent?) from termcap.

No, the problem is in curses (if any particular bit of software can be
blamed), not termcap or terminfo.  Neither termcap nor terminfo provide
any input-handling routines.  They exist only to describe the terminal's
interface and handle output parameters (for, e.g., cursor motion).

>The problem is caused by the necessity of dealing with "function keys",
>"cursor keys", and other symbolic keys on the keyboard.

Right.  The timing code for curses `getch', however, is entirely in
curses (and the 4BSD termcap-based curses provides no function key
decoding at all, so it is not in all versions).

Because keystrokes can be arbitrarily delayed (e.g., by networks), the
timer hack is not such a great solution.  My own solution is never to
use function keys.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 405 2750)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list