| www.delorie.com/archives/browse.cgi | search |
| From: | Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: ATT assembler question |
| Date: | 11 Aug 2003 11:58:20 GMT |
| Organization: | Aachen University of Technology (RWTH) |
| Lines: | 28 |
| Message-ID: | <bh80cs$p9k$1@nets3.rz.RWTH-Aachen.DE> |
| References: | <uvft612b8 DOT fsf AT elta DOT co DOT il> <20030810061007 DOT 03017 DOT 00001081 AT mb-m19 DOT aol DOT com> |
| NNTP-Posting-Host: | acp3bf.physik.rwth-aachen.de |
| X-Trace: | nets3.rz.RWTH-Aachen.DE 1060603100 25908 137.226.32.75 (11 Aug 2003 11:58:20 GMT) |
| X-Complaints-To: | abuse AT rwth-aachen DOT de |
| NNTP-Posting-Date: | 11 Aug 2003 11:58:20 GMT |
| Originator: | broeker@ |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
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.
> 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?
Your assembly snippet would map quite exactly to this, in C:
if (kbhit()) {
getkey();
/* do something with the key */
}
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |