Does SysV curses "notimeout(win, FALSE)" really work?

ames!ultra!!rmg at uunet.uu.net ames!ultra!!rmg at uunet.uu.net
Tue May 8 11:06:59 AEST 1990


The SunOS 4.0.3 curses(3V) man pages states that, by default, when
"keypad(win, TRUE)" is in effect when "wgetch(win)" is called, a timer
will be started after recieving an Esc character, and, if the timer times
out, the Esc will be passed back to the caller. This is to distinguish
between an Esc leading in to a function key sequence and one typed by the
user. But I can't seem to make it work like that.

Here is the test program I am using:

Makefile:
---------
CC      =/usr/5bin/cc
LIBS    =-ldb /usr/5lib/libtermlib.a

all:	ctst

ctst: ctst.o
	$(CC) -o ctst ctst.o $(LIBS)

ctst.c:
-------
#include <stdio.h>
#include <curses.h>

main()
{
  int ch;

  initscr();

  cbreak();
  noecho();
  nonl();
  raw();

  keypad(stdscr, TRUE);

  wmove(stdscr, 1, 1);

  ch = wgetch(stdscr);
  printf("got 0x%2x\n", ch);
  endwin();
}
-------

The program will never return a single Esc character when it is typed.
What gives? Or is it a ten minute timeout? (I haven't waited *that* long
yet!) :-)

 - Rich Geiger
Ultra Network Technologies / 101 Daggett Drive / San Jose CA 95134
rmg at ultra.com  ...!ames!ultra!rmg  (408) 922-0100 [w]  (408) 739-7911 [h]



More information about the Comp.sys.sun mailing list