Lines: 39 X-Admin: news AT aol DOT com From: sterten AT aol DOT com (Sterten) Newsgroups: comp.os.msdos.djgpp Date: 12 Aug 2003 14:44:31 GMT References: Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com Subject: Re: ATT assembler question Message-ID: <20030812104431.28413.00000342@mb-m10.aol.com> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hans-Bernhard Broeker wrote: Sterten wrote: > >> I'm afraid not. getkey and getxkey interrupt the program and wait >> until the user presses a key. > >You didn't really look into the docs, did you? You should have found >about the capability of bioskey() to just see if a key was already >pressed if you did. < >Or you would have found the kbhit() function. I went to the /info directory, put everything there in one big file and searched this file for keywords. No referrence to kbhit from any of the 4 other mentioned functions. No mention of kbhit in the FAQ , BTW. >> If e.g. someone presses and 5 minutes later , >> then won't be recognized by bioskey. > >So what? Did it really not occur to you that you can't have it both >ways --- being informed about new keypresses, but still ignoring keys >pressed a while ago? The program below seems to do exactly that : >Your assembly snippet would map quite exactly to this, in C: > > if (kbhit()) { > getkey(); > /* do something with the key */ > } exactly ! Thanks. Very useful, frequently needed routine IMO. Guenter