From: "Robinson S." Newsgroups: comp.os.msdos.djgpp Subject: Re: Trap Keyboard Events Date: Sun, 29 Aug 1999 00:39:10 -0400 Organization: ICAN.Net Customer Lines: 33 Message-ID: <37C8B96E.4BC9@lords.com> References: <37C156BB DOT 4808 AT lords DOT com> NNTP-Posting-Host: dialin340.toronto.globalserve.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.04 (Win95; U) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Al Morgan wrote: > > I think what you want is... "kbhit()". It will return true when a key has > been pressed, like this: > > #include > #include // kbhit is in there, i think it might be in > stdlib.h too, not sure. > > void main() > { > int n = 0; > while(!kbhit()) > { > cout << n++ << endl; > } > } > > This program will count from 0 to infinity until the user presses a key. > > Is that what you were looking for? > Al [muaddib AT proaxis DOT com] Thank u, the _kbhit() function from conio.h works (there seems to be no kbhit() function--needs the _ at beginning). This maybe because of the compiler I am using: lcc-win32. -- Robinson S., mailto:roby AT lords DOT com