Date: Tue, 5 Oct 1999 09:54:33 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Roland Moritz cc: djgpp AT delorie DOT com Subject: Re: How to empty the keyboard buffer In-Reply-To: <7tajaf$q2a$1@rohrpostix.uta4you.at> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 4 Oct 1999, Roland Moritz wrote: > And now my question is, how do I empty the keyboard buffer everytime the > loop is through, since I don't want, for example, that if a message is shown > for 5 Seconds, and the player pushes some keys, that they will be used as > keyboard input the next time the loop is running through, since there are > still keys in the buffer...I've tried it with something simple like > > while (kbhit() > c = getch(); > > But it does'nt work... The above *is* the way to empty the keyboard. If it doesn't work for you, please post the shortest test program that can be compiled and that demonstrates how does it fail. Please also tell how do you run the test program and what do you expect to happen if it did work.