Date: Wed, 5 Jun 1996 19:06:01 +0200 (IST) From: Eli Zaretskii To: Steve Higgins Cc: "'DJGPP Mail List'" Subject: Re: Replacing stdin / stdout with my own versions. In-Reply-To: <01BB512C.115C67A0@psp3> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 3 Jun 1996, Steve Higgins wrote: > I started by writing a simple program to see if this is possible (see below). > What it should do is grab the keyboard BIOS interrupt (0x16) and reply > with a carrage return whenever a keypress is asked for. > > What seems to happen is that the program gets as far as getchar() and then > waits for ever. One possible reason might be that `getchar' uses buffered I/O, so it won't return anything until you either hit [Enter] or fill its buffer with many keystrokes. What happens if you type a few characters, then hit [Enter]? Another thing to try is to use an unbuffered DOS console I/O function so that you won't be fooled by the buffering.