delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/08/12/11:13:19

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: <bh80cs$p9k$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
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 <sterten AT aol DOT com> 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 <blank> and 5 minutes later <esc> ,
 >> then <esc> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019