home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / pc_hw / kb / kbhit.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  775 b   |  33 lines

  1. @node kbhit, bios
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <pc.h>
  6.  
  7. int kbhit(void);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. If the user has hit a key, this function will detect it.  This function
  13. is very fast when there is no key waiting, so it may be used inside
  14. loops as needed. 
  15.  
  16. If you test shift/alt/ctrl status with bios calls (e.g., using
  17. @code{bioskey (2)} or @code{bioskey (0x12)}) then you should also use
  18. bios calls for testing for keys.  This can be done with by
  19. @code{bioskey (1)} or @code{bioskey (0x11)}.  Failing to do so can
  20. cause trouble in multitasking environments like DESQview/X.
  21.  
  22. @subheading Return Value
  23.  
  24. Nonzero if a key has been hit, else zero.
  25.  
  26. @subheading Example
  27.  
  28. @example
  29. while (!kbhit())
  30.   do_stuff();
  31. @end example
  32.  
  33.