home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14391 < prev    next >
Encoding:
Internet Message Format  |  1992-08-23  |  1.7 KB

  1. Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ames!pacbell.com!network.ucsd.edu!ucsbcsl!mcl!scott
  2. From: scott@mcl.ucsb.edu (Scott Bronson)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: GetKeys, Events, Sound Manager
  5. Message-ID: <scott.714611988@mcl>
  6. Date: 23 Aug 92 23:19:48 GMT
  7. References: <9208102354.aa06431@Paris.ics.uci.edu> <Bsu03H.8Cn@taligent.com> <1992Aug11.203247.15836@athena.mit.edu> <1992Aug11.214555.19599@midway.uchicago.edu>
  8. Sender: root@ucsbcsl.ucsb.edu
  9. Lines: 21
  10.  
  11. In <1992Aug11.214555.19599@midway.uchicago.edu> jcav@quads.uchicago.edu (JohnC) writes:
  12. >In article <1992Aug11.203247.15836@athena.mit.edu> slchambe@athena.mit.edu (Stephen L Chamberlin) writes:
  13. >>2. How can I get events without granting any processor time to background
  14. >>tasks? I'd like to be able to use keyDown and mouseDown events in my program,
  15. >>but due to the timing-sensitive nature of the program, I don't want to give
  16. >>any time to background tasks. As far as I can tell, GetNextEvent and and
  17. >>WaitNextEvent always give some time to background tasks.
  18.  
  19. >If you need to do this, use _GetOSEvent, which does nothing but retrieve an
  20. >event from the queue.  Be aware that only events created by _PostEvent will
  21. >be found.  You won't see update events, activate events, OS events or
  22. >high-level events.
  23.  
  24. Another solution is to put up your window in a dBoxProc-type dialog.  This
  25. will by definition prevent switching.  Perhaps put the dBoxProc in front
  26. offscreen, then HiliteWindow your window to make it look like it's in front
  27. again.  Getting really kludgy, but you will get update events.  Trap the
  28. events using a dialog filter so that you can pass them to your app and
  29. you can almost pretend the dialog isn't offscreen preventing switching.
  30.  
  31.     - Scott
  32.