Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!samsung!crackers!m2c!umvlsi!dime!dime.cs.umass.edu!nayeri From: nayeri@cs.umass.edu (Farshad Nayeri) Newsgroups: comp.sys.mac.hypercard Subject: Re: Trapping out Command-Period key presses. Message-ID: Date: 13 Sep 90 13:35:55 GMT References: <7433@milton.u.washington.edu> <10190@goofy.Apple.COM> Sender: news@dime.cs.umass.edu Reply-To: nayeri@cs.umass.edu Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst) Lines: 41 In-reply-to: stm@apple.com's message of 12 Sep 90 23:07:06 GMT In article <10190@goofy.Apple.COM> stm@apple.com (Steve Maller) writes: In article <7433@milton.u.washington.edu> bjornl@milton.u.washington.edu (Bjorn Levidow) writes: > Does anybody know how to trap out Command-Period key presses by the users? HyperCard 2.0 has a new property called "cantAbort". It prevents Command-Period from doing anything. However, note that this is VERY dangerous, because causing a script to be un-stoppable could force a user to reboot his machine if the script runs away from itself. This can easily destroy a stack! Steve, why can't command-period be an event and generate a message just like anything else? So that you can specify a handler in the hierarchy? It seems to make a lot of sense to me. So programmer can specify a handler like: on abort -- or commandPeriod or whatever you want to call it answer "Don't you touch that key combination again!" doMenu "Quit Hypercard" end abort Of course, the cantAbort property should be true for this handler. This would also be nice because if the programmer finds an abort condition, they could just do abort. on checkAllNamedCards if bg fld "name" of this cd is empty then abort else put bg fld "name" end checkAllNamedCards I think this would be much nicer to use. Any reactions? --farshad -- Farshad Nayeri Object Oriented Systems Group nayeri@cs.umass.edu Dept. of Computer and Information Science (413)545-0256 University of Massachusetts at Amherst