From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem with kbhit() Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: <3A5AE4E7 DOT 85120936 AT student DOT uni-ulm DOT de> <3A5AEFF6 DOT C2432EBE AT student DOT uni-ulm DOT de> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 26 X-Trace: /K+neVnRk3KyMrej2wkS/Ou7Avi7Sw+aurX0PsIjZVYeIPK2TrsjFveo76tMZgNgFng5tt4LRL7u!MDjdE9OUf4X0qsJuUht18KIK+NZhEFdlLjqPSCIp+UNCTyc+flT0lny+RXswlvZYesCtUdzcTwAC!7fltDg== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Thu, 11 Jan 2001 02:49:43 GMT Distribution: world Date: Thu, 11 Jan 2001 02:49:43 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Tue, 09 Jan 2001 12:03:18 +0100, Karsten Schmidt wrote: >I guess I found a solution: I have to poll the character with getch() > >> int main (void) >> { while(!kbhit()) // Wait until key pressed >> { printf("."); >> delay(1000); } > > getch() <-------- read keyboard This may screw things up with respect to extended keys (Fkeys, arrows). An extended key will return 0 on the first read then a scancode on the second read. if(getch() == 0) getch(); --