www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/05/12:13:34

Date: Wed, 5 Jun 1996 19:06:01 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Steve Higgins <steve AT psp-digital DOT co DOT uk>
Cc: "'DJGPP Mail List'" <djgpp AT delorie DOT com>
Subject: Re: Replacing stdin / stdout with my own versions.
In-Reply-To: <01BB512C.115C67A0@psp3>
Message-Id: <Pine.SUN.3.91.960605190234.26657K-100000@is>
Mime-Version: 1.0

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. 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019