🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #256

How to flush keyboard buffer?

#256
From: Mark Scase
Date: Thu, 06 Aug 1992 10:23
20 lines
896 bytes
I'm sure the answer to this must be obvious but I can't figure it
out!

I'm programming in MSDOS with Borland C.  How do you flush the
internal keyboard buffer?

What I'd like to do is something like this:

read key from keyboard
do something else and ignore any keys pressed
flush keyboard buffer
do something
read key from keyboard

This is not a FAQ - I've looked.  If someone could tell me the
solution or even give me an example of C code I'd be eternally
grateful.
Thanks,
Mark Scase    coa44@keele.ac.uk
	   or coa44%keele.ac.uk@nsfnet-relay.ac.uk
Technical Details
Message-ID: <3721@keele.keele.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!keele!coa44

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!keele!coa44
From: coa44@seq1.keele.ac.uk (Mark Scase)
Newsgroups: comp.os.msdos.programmer
Subject: How to flush keyboard buffer?
Keywords: DOS, keyboard buffer
Message-ID: <3721@keele.keele.ac.uk>
Date: 6 Aug 92 10:23:27 GMT
Organization: University of Keele, England
Lines: 20