home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / wizards / 4580 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.2 KB

  1. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!valois!bernt
  2. From: bernt@valois (Bernt Skottun)
  3. Newsgroups: comp.unix.wizards
  4. Subject: Keyboard hit in C programs
  5. Date: 9 Nov 1992 23:29:54 GMT
  6. Organization: University of California, Berkeley
  7. Lines: 16
  8. Distribution: world
  9. Message-ID: <1dms9iINNa6m@agate.berkeley.edu>
  10. NNTP-Posting-Host: 128.32.157.154
  11. Keywords: Keyboard hit, C programs, UNIX
  12.  
  13.  
  14. I am in the process of adapting a C program from the PC for
  15. the UNIX environment (for SUN 3 running SUNOS 4.1.1).
  16. In this program it is essential that
  17. the user be able to stop certain parts of the program
  18. (e.g. an inner loop) by hitting the keyboard (any key
  19. is fine) while as long as the keyboard is not touched the execution
  20. of the program will continue un-interupted (thus a procedure
  21. which requires, or expects, the user to type in a key stroke at certain
  22. intervals will not do). In the DOS environment
  23. I have been able to do this with the "kbhit()" function.
  24. My question is: what is the equivalent function in the UNIX
  25. environment? or how does one go about creating such a function?
  26. Any suggestions will be very welcome. Thanks a lot.
  27. Bernt Skottun, bernt@valois.berkeley.edu 
  28.  
  29.