home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!gatech!usenet.ins.cwru.edu!news.ysu.edu!do-not-reply-to-path
- From: af458@yfn.ysu.edu (Jon K. Salmon)
- Subject: Re: Summary: How to flush keyboard buffer
- Message-ID: <1992Aug14.014304.27238@news.ysu.edu>
- Sender: news@news.ysu.edu (Usenet News Admin)
- Nntp-Posting-Host: yfn
- Organization: Youngstown State University/Youngstown Free-Net
- Date: Fri, 14 Aug 1992 01:43:04 GMT
- Lines: 25
-
-
- brown@NCoast.ORG (Stan Brown) writes:
-
- >> while (kbhit()) getch();
- >> while (bioskey(1)) bioskey(0);
-
- > These two are very likely the same thing. If they are implemented in
- > the obvious way, however, they will miss keystrokes like F12.
-
- The kbhit/getch version uses DOS calls (Int 21h, func. 0Bh and 07h,
- respectively). Note that the getch routine also contains support for
- the ungetch function.
-
- The bioskey routine calls BIOS (Int 16h, func. 01h and 00h).
-
- True, an F12 keypress will not be detected by these calls; the BIOS
- functions (0 and 1) will "automatically" ignore such keypresses. Note
- that Int 16h, functions 10h and 11h, on the other hand WILL grab such
- keys. However, since the goal is to flush the buffer, the bioskey
- functions work just fine. Note, furthermore, that Borland has NOT
- implemented the 10h and 11h calls; i.e. you cannot simply call
- bioskey(10h) to read an F12 keypress.
-
- -- Jon
- --
-