home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 18916 < prev    next >
Encoding:
Text File  |  1992-12-27  |  883 b   |  22 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!think.com!ames!pacbell.com!UB.com!quack!dfox
  3. From: dfox@quack.sac.ca.us (David Fox)
  4. Subject: Unix equivalent to DOS kbhit() function?
  5. Message-ID: <fXawiU0@quack.sac.ca.us>
  6. Keywords: kbhit, getch, low-level keyboard control
  7. Organization: The Duck Pond public unix: +1 408 249 9630, log in as 'guest'.
  8. Date: 27 Dec 1992 22:09:08 UTC
  9. Lines: 11
  10.  
  11. puts("hello");
  12.  
  13. I am a relatively new Unix user, although I've used DOS C (MSC/Turbo C)
  14. for sometime.  I've read the FAQ about how to get only one character
  15. from the console, which pertains to using getch() in curses, which 
  16. seems to work all right, but that's not really what I'm after.  What I
  17. want is to do something similar in Unix to what the DOS C kbhit() call
  18. does - which only returns something if the keyboard has been hit.  The
  19. idea here is to run something in a loop until a keypress.
  20.  
  21.  
  22.