Message-ID: <34878CD0.3AB5@mailexcite.com> Date: Fri, 05 Dec 1997 00:10:40 -0500 From: Doug Gale 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: embernet31.idirect.com Lines: 36 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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.