home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5314 < prev    next >
Encoding:
Text File  |  1992-07-28  |  1.4 KB  |  37 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!psinntp!svc!news
  3. From: moose@svcdudes.com
  4. Subject: Re: (probably) newbie question about keyboard intercepts
  5. Message-ID: <1992Jul28.164914.4863@svcdudes.com>
  6. Sender: news@svcdudes.com
  7. Reply-To: moose@svcdudes.com
  8. Organization: Software Ventures, Inc.
  9. References: <1992Jul27.220624.1369@fnbc.com>
  10. Distribution: na
  11. Date: Tue, 28 Jul 92 16:49:14 GMT
  12. Lines: 23
  13.  
  14. In article <1992Jul27.220624.1369@fnbc.com> dennis@fnbc.com (Dennis Box )  
  15. writes:
  16. > Hello all,
  17. > I have a NextStep application that occasionally goes into a (long) loop
  18. > when a user asks the wrong query of its database. I have been asked
  19. > to change this behaviour so that a control-c ejects the program from the
  20. > loop, returning control to the main event loop.
  21. > My question is, where do keyboard interrupts go, and how does a programmer
  22. > detect and use them?  The unix <signal.h> stuff doesn't work, NextStep or
  23. > Mach or something obviously grabs signals uses them to its own ends.
  24.  
  25. You can get the next key event with a getNextEvent: method in Application, or  
  26. you can directly querry them using the evs stuff (look in the man pages).
  27.  
  28. However, NeXT recommends you use the NXUserAborted() function to detect the  
  29. user hitting cmd-.
  30. --
  31. Michael Rutman            |    moose@svcdudes.com
  32. Cubist                |    makes me a NeXT programmer
  33. Software Ventures        |    maker of MicroPhone II
  34. #include <std.disclaimer>
  35.