Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!usenet.ins.cwru.edu!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!apple!dlyons From: dlyons@Apple.COM (David A. Lyons) Newsgroups: comp.sys.apple2 Subject: Re: SetVector and Keyboard Interrupts Keywords: SetVector, Keyboard Interrupts Message-ID: <42638@apple.Apple.COM> Date: 4 Jul 90 22:50:36 GMT References: <266201eb.2a84@petunia.CalPoly.EDU> <42395@apple.Apple.COM> <1415@madnix.UUCP> Organization: Apple Computer Inc, Cupertino, CA Lines: 28 In article <1415@madnix.UUCP> jason@madnix.UUCP (Jason Blochowiak) writes: >In article <42395@apple.Apple.COM> dlyons@Apple.COM (David A. Lyons) writes: >> [...] but I can think of at least one hacky way: patch >>SetVector to check for vector number $000f, handle all the others by passing >>control to the Real SetVector code, and handle $f by keeping the passed >>handler for your own use & giving YOUR address to the real SetVector. When >>your handler is called, you can call the Real vector if you don't want the >>keypress. > >Oooh, ick! Then wouldn't it also be necessary to watch for EMStartUp & >EMShutDown calls, so that any app that relied on the vector patches being >purged on EMShutDown wouldn't cause a post-run crash? I don't see the difficulty--EMShutDown call SetVector to restore the keyboard interrupt vector to its pre-EMStartUp value. (I suppose you would also have to patch GetVector to return the "real" value instead of the patch.) This approach works with keyboard interrupts (as enabled and disabled with IntSource) whether or not the event manager is used. -- David A. Lyons, Apple Computer, Inc. | DAL Systems Apple II Developer Technical Support | P.O. Box 875 America Online: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.