Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!gatech!hubcap!morourk From: morourk@hubcap.UUCP (michael orourke) Newsgroups: comp.sys.mac.programmer Subject: Re: VBL Tasks Message-ID: <4418@hubcap.UUCP> Date: 14 Feb 89 01:01:02 GMT References: <4398@hubcap.UUCP> <99000007@silver> Organization: Clemson University, Clemson, SC Lines: 23 In article <99000007@silver>, sl161022@silver.bacs.indiana.edu writes: > > "VInstall and i understand about setting up a VBLTask record. However, what > "if the procedure I install needs to be called only when a certain key combo > "is hit? Does it have to scan the event queue or something? > > "I want it running all the time in the background. > > Actually, another way to do this (and the way I use to do a similar thing) > is to install a patch for _GetOSEvent, which is called quite frequently. > In fact, whenever the Finder, the running application, or any DA is ready > to respond to an event, it will call either _GetNextEvent (which goes > through the Toolbox Event Manager) or _GetOSEvent (which goes directly > through the Operating System.) Since _GetNextEvent calls _GetOSEvent, > you can patch _GetOSEvent and you'll be essentially guaranteed access > to any keypress, and you can then do whatever you want. Sounds great. Only one problem. There followed after this response a lot of assembly language code examples. But I don't know assembly language so I couldntmake heads or tail of what to do. How do I install a patch to a routine like GetOSEvent? Michael O'Rourke