Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!decwrl!ucbvax!pasteur!draco!carlton From: carlton@draco (Mike Carlton) Newsgroups: comp.sys.mac.programmer Subject: Re: Background MAGIC (and I don't mean multifinder!!) Message-ID: <26932@pasteur.Berkeley.EDU> Date: 11 Aug 90 00:01:47 GMT References: <8JTNK0C@cs.swarthmore.edu> <82899@tut.cis.ohio-state.edu> <23598@dartvax.Dartmouth.EDU> <9694@goofy.Apple.COM> Sender: news@pasteur.Berkeley.EDU Reply-To: carlton@draco.berkeley.edu (Mike Carlton) Organization: University of California at Berkeley Lines: 40 In article <9694@goofy.Apple.COM> stevec@Apple.COM (Steve Christensen) writes: +In article <23598@dartvax.Dartmouth.EDU> Joe Francis writes: +>In article <82899@tut.cis.ohio-state.edu> brian e topping writes: +>->Actually, if you have ever looked inside what SuperClock, Pyro, and the like +>->are doing, you will have found a safer method. I can never remember where +>->I saw this documented, but it is somewhere in the phone book edition +>->(the brown pages). The trick is to use the low memory global jGNEFilter, +>->defined in the Apple assembler equates as: +> +>-> JGNEFilter EQU $29A; GetNextEvent filter proc [pointer] +> +>->This seems preferred over other methods because if the app isn't calling +>->WaitNextEvent, it probably is too busy to have cycles eaten up by screen +>->savers and the like. +> +>If you do this (and I don't recommend it), make sure that you call the +>previous contents of the global (if they are not null), otherwise other +>"lurkers" using this method will be high and dry. + +jGNEFilter should never be nil since there is a default filterProc installed +before anyone else gets their fingers in. The other important point is to +be sure to save A1 (and maybe D0) around your code since others down the +chain are expecting it to be setup... + +steve + Is using jGNEFilter safer or more dangerous than patching GetNextEvent? I've got an init which wants to steal some events. Right now it patches GNE and searchs the event queue and removes the one it wants. I could instead use jGNEFilter and turn the event I want into a null event before it is returned. Given that both methods would work for me, which is least likely to break when new system software comes out (like, maybe 7.0 :)? Is there any preference? cheers, Mike Carlton, UC Berkeley Computer Science ~ carlton@ernie.berkeley.edu ...!ucbvax!ernie!carlton Manana