delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/05/07:45:22

Message-ID: <34878CD0.3AB5@mailexcite.com>
Date: Fri, 05 Dec 1997 00:10:40 -0500
From: Doug Gale <dgale AT mailexcite DOT com>
Reply-To: dgale AT mailexcite DOT com
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: keyboard problem!
References: <65iu4r$ca1$1 AT yeppa DOT connect DOT com DOT au> <6608mn$g5u AT mtinsc05 DOT worldnet DOT att DOT net> <3485301B DOT 3A13 AT trash DOT lip6 DOT fr>
NNTP-Posting-Host: embernet31.idirect.com
Lines: 36
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Fabrice ILPONSE wrote:
> 
> Walter Luke wrote:
> >
> > #include "dos.h"
> > #include "stdio.h"
> >
> > char y;
> >
> > getkey(void) {
> >
> > union REGS r;
> >
> > r.h.ah = 0;
> > return int86(0x16, &r, &r);
> >
> > }
> >
> 
>         Why using int86?
> 
>         you could use:
> 
>         temp=getch();
>         sc.ch[0]=temp;
>         if (!temp) sc.ch[1]=getch();
> 
>         (it's just my opinion!! :) )
[snip]

There is a big difference! 

The BIOS call always reads the keyboard. 

getch() reads from standard input, which may have been redirected at the
command-line to read from a device or a file.

- Raw text -


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