Date: Tue, 9 Jan 2001 13:02:22 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Karsten Schmidt cc: djgpp AT delorie DOT com Subject: Re: Problem with kbhit() In-Reply-To: <3A5AE4E7.85120936@student.uni-ulm.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Tue, 9 Jan 2001, Karsten Schmidt wrote: > I'm trying to detect when the user hits the keyboard. > Unfortunately the kbhit() function is always true > after the first key has been hit. Therefore I'm not able to > detect any further hits. You need to remove the key from the keyboard queue; kbhit doesn't do that. So the key stays in the queue and kbhit reports a non-zero value forever. You can remove the key from the queue with a call to getkey, for example.