From: Simon Newsgroups: comp.os.msdos.djgpp Subject: Re: Flusing keyboard buffer Date: Sun, 17 Jan 1999 15:34:45 +0000 Organization: Customer of Planet Online Lines: 24 Message-ID: <36A20315.588B@magicsoftware.freeserve.co.uk> References: NNTP-Posting-Host: modem-99.skier.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news6.svr.pol.co.uk 916587402 19856 62.136.136.99 (17 Jan 1999 15:36:42 GMT) NNTP-Posting-Date: 17 Jan 1999 15:36:42 GMT X-Complaints-To: abuse AT theplanet DOT net X-Mailer: Mozilla 3.04Gold (Win95; I) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii wrote: > > On Sat, 16 Jan 1999, Simon wrote: > > > Can anyone tell me a function that will remove all unfetched > > key strokes from the keyboard buffer ! > > Here's one possible way: > > while (kbhit ()) > getkey (); I meant to say that if the buffer contains keystrokes that were from some time ago and I want to totally disregard them and wait for new presses. I want do some code such as: //flush old unwanted keys flush_kb_buffer(); //wait for new presses while (kbhit ()) getkey (); Thanks Simon