home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8530 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.3 KB  |  37 lines

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