Mail Archives: djgpp/1995/08/30/09:40:25
I have been using DJGPP2 quite happily in my DOS (spew) enviroment. Now I
want to be able to develop under unix/linux. I've tried to run some simple
test programs that involve kbhit in a while loop. This is obviously fine in
DOS but linux doesn't have kbhit. What I need to do is read the current count
of characters/keypresses stored in the keyboard buffer (stdin???).
I've tried feof(stdin) but the terminal streams don't seem to have an EOF
indicator. I have also tried getchar() with setvbuf(stdin, NULL, _IONBF, 0)
for unbufferd stream. No luck.
Anybody have any suggestions. Is there something more portable that kbhit()
that I can use on both OS platforms.
Brendan Simon
brendan AT rdt DOT monash DOT edu DOT au
- Raw text -