Path: utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Death of jGNEFilter? Message-ID: <9074@hoptoad.uucp> Date: 24 Nov 89 20:23:12 GMT References: <2323@hudson.acc.virginia.edu> <9068@hoptoad.uucp> <6020@ucdavis.ucdavis.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 34 In article <6020@ucdavis.ucdavis.edu> lim@iris.ucdavis.edu (Lloyd Lim) writes: >The best suggestion I can make is that you can head patch PostEvent and >PPostEvent if your patch doesn't move memory. If you're doing something else >that doesn't move memory this might work for you. Seems iffy to me. PostEvent is called at the interrupt level when the frontmost application does not necessarily have control. Scenario: Your application has been moved to the back in MultiFinder. An idle event happens on the frontmost application and the mac gives time to the background applications, including yours. While yours is running, an interrupt posts a mouse or keyboard event. Your trap patch fires, telling you that you've gotten an event, even though teh event is really for someone else. I suppose you could use teh suspend event to keep track of whether you're in the front or not, but this seems like a fragile patch. Another problem comes in the reverse situation. You could be in front and the PostEvent could happen while another application is getting time. Then your patch won't fire. No way around that. >How about setting a flag in your PostEvent head patches and checking for it in >a head patch to GetNextEvent and company? Depending on the flag, you can play >your sound(s) before GetNextEvent gets called. It shouldn't matter what >event mask the call has since you just want to play sounds whenever a key was >previously hit. Well, except that it requires a PostEvent trap, and the user interface might feel wrong if the event being handled isn't the event for which the sound is desired. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "As I was walking among the fires of Hell, delighted with the enjoyments of Genius; which to Angels look like torment and insanity. I collected some of their Proverbs..." - Blake, "The Marriage of Heaven and Hell"