| delorie.com/archives/browse.cgi | search |
| From: | "Andrew Jones" <luminous-is AT home DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| References: | <sb7v86rer2a162 AT corp DOT supernews DOT com> <38B3FF66 DOT A4EF6CC6 AT corel DOT com> |
| Subject: | Re: how to read keys |
| Lines: | 18 |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-Newsreader: | Microsoft Outlook Express 5.00.2919.6600 |
| X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2919.6600 |
| Message-ID: | <XnVs4.72553$45.4010587@news2.rdc1.on.home.com> |
| Date: | Wed, 23 Feb 2000 18:09:59 GMT |
| NNTP-Posting-Host: | 24.42.120.18 |
| X-Complaints-To: | abuse AT home DOT net |
| X-Trace: | news2.rdc1.on.home.com 951329399 24.42.120.18 (Wed, 23 Feb 2000 10:09:59 PST) |
| NNTP-Posting-Date: | Wed, 23 Feb 2000 10:09:59 PST |
| Organization: | @Home Network Canada |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
> Try getch()..
[snip]
Additionally, if you just want to get a key if there is one, you can use
something like (ie for a game loop):
while(1) /* or any other condition you like */
{
if(kbhit()) inkey = getch();
if(inkey == KB_ESCAPE) break;
}
This is a simple and common example.
AndrewJ
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |