| delorie.com/archives/browse.cgi | search |
| From: | Simon <simon AT magicsoftware DOT freeserve DOT co DOT uk> |
| 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: | <Pine DOT SUN DOT 3 DOT 91 DOT 990117122657 DOT 278d-100000 AT is> |
| NNTP-Posting-Host: | modem-99.skier.dialup.pol.co.uk |
| Mime-Version: | 1.0 |
| 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
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |