Re^2: How to test if a key has been hit w/o waiting for a key ?

Mike Faber sleepy at wybbs.mi.org
Sat May 5 00:01:56 AEST 1990


I missed parts of this, but couldn't you use ioctl?  
Set yourself up as nonicanonical processing, and in the array struct.c_cc,
set the VMIN element (struct.c_cc[VMIN]) to 0 and VTIME element to 1.  Then a
getchar() or getc()  will return -1 if no characters were received.
If you want to put it back, ungetc(or something like that) is supposed to
work...



More information about the Comp.lang.c mailing list