[quoted lines by Gerd Hoffmann on 2014/05/27 at 11:09 +0200]

>Which means exactly?  They are not prepared to find data for more than
>one key event in the buffer?

Not exactly. The bad code is an attempt to do a nonblocking keyboard read in 
MS-DOS. It goes like this:

1) Peek the DOS keyboard buffer start and end pointers. If the buffer is empty 
   then return "no input".

2) If no key is pressed then return "no input".

3) Use the blocking MS-DOS interface to wait for the next key and return it.

So, as you can see, there's a serious problem. Let's say that a key press and 
release go in together. That give us the following situation:

1) Peek the DOS input buffer. It isn't empty so proceed to the next step.

2) No key is pressed so return "no input".

I really do think, therefore, that the only way to deal with this is to slow 
down the input to typing speed.

-- 
Dave Mielke           | 2213 Fox Crescent | The Bible is the very Word of God.
Phone: 1-613-726-0014 | Ottawa, Ontario   | http://Mielke.cc/bible/
EMail: d...@mielke.cc | Canada  K2A 1H7   | http://FamilyRadio.com/

Reply via email to