the pendingClick

DunbarX at aol.com DunbarX at aol.com
Tue Aug 10 17:22:11 EDT 2010


In HC, I always distinguished, within a single mouseUp handler, the 
difference between a single mouseClick and a double mouseClick as:

on mouseUp
   wait 15
   if the mouseClick then put "Double" else put "Single"
end mouseUp

But it seems more modern, more revLike, to use a mouseUp handler and a 
mouseDoubleUp handler:

on mouseUp
   put "Single"
end mouseUp

on mouseDoubleUp
   put "Double"
end mouseDoubleUp

Of course, both messages are sent, as they ought to be, and you see both 
results. 

Is there are way to do this with two handlers? Like:

on mouseUp
   if there is a handler "mouseDoubleUp" in this script then exit mouseUp
   put "Single"
end mouseUp

Of course, the "is a" operator takes no such argument, though one could 
easily determine if a mouseDoubleUp handler actually existed, and set a flag or 
property on mouseDown, say. But is there a cleverer way?



More information about the Use-livecode mailing list