stdin and the keyboard
Alessandro Rubini
rubini at ipvvis.unipv.it
Fri Jun 28 02:47:44 AEST 1991
Mike Dowell (mdowell at dante.nmsu.edu) writes:
> I am trying to write a replacement for the DOS more command. I would
> like it to function as closely like the original as possible,
> therefore piping of commands is needed, ie dir | more.
> I can't get it to recognize the keyboard and the input command
> separate instead of both being the stdin.
> I am running Borland C++ on a PC if that helps any.
I use MSC, but I think It's the same.
Getch _does_ read stdin, though the library reference
claims it reads the keyboard.
You should read the keyboard through int86(16H,...), usable also to flush
the input buffer. Of course, you're killing portability...
If you're not familiar with INTs I can give you a little inkey(), allowing
you to filter the input, too. I wrote it to implement F1-HELP.
Ru.
--
Alessandro Rubini Almo Collegio Borromeo
Piazza Borromeo 9
More information about the Comp.lang.c
mailing list