Trapping Command-q

Jason Tangen jtangen at psy.uq.edu.au
Thu May 18 00:02:57 EDT 2006


Sarah's commandKeyDown trap doesn't seem to work, which is why I'm  
puzzled.  Marty: Ken's method would work to prevent the user from  
quitting Rev, but I was hoping to find a more general method that I  
might use to trap various Apple events such as Command-P and Command- 
W.  Again - I'm sure that I used a solution like Sarah's once upon a  
time, but it doesn't seem to work now.  Obviously this wasn't an  
issue at all in MetaCard...

Cheers,
Jason

> In my experience, trapping for a quit message on OS X is not  
> reliable. It works most of the time, but not all of the time. Ken's  
> method, which my previous post referred to, is the only method that  
> I've found to be reliable. Specifically, his "Brute force" method.  
> (He details 2 methods on his site.)
>
> Marty Knapp
>
>>> How about trapping the commandKeyDown message?
>>>
>>> on commandKeyDown pKey
>>> if pKey = "Q" then
>>>     answer "You are not allowed to quit :-)"
>>> else
>>>     pass commandKeyDown
>>> end if
>>> end commandKeyDown
>>>
>>>
>>> HTH,
>>> Sarah
>>>
>> On 5/18/06, Jason Tangen <jtangen at psy.uq.edu.auwrote:
>> Can someone tell me how to prevent a user from using Command-q to  
>> quit Revolution? I'm sure that I used to be able to do it, but not  
>> anymore.  Did something change?



More information about the use-livecode mailing list