Mobile tao: mouseStillDown, mouseUp, answer dialog

Mike Kerner MikeKerner at roadrunner.com
Sat Nov 5 11:11:33 EDT 2016


This is the second time I've been bitten by this, so this is more a note to
me for the next time it happens, because I had forgotten what I learned,
the first time, and I didn't look in the right place for my notes on the
subject, but I did look here.

For some context, I was trying to (poorly) emulate 3d touches by handling
mouseStillDown on mobile.


1) mouseStillDown does not propogate.  ONLY the object that the user is
touching will receive it.  If the object is part of a group, the group will
not get the message.  You have to specifically send the message to the
group for the group to get and handle it.  This is important if you are
using a skinning tool.  If that group has an icon and a face, make sure you
catch and send mouseStillDown in both.

2) The answer dialog on mobile is not truly modal.  Think of it as having a
transparent background that sits over your stack.  So, if you catch
mouseStillDown and pop up an answer dialog, when you stop pressing on the
object (so you can tap on the dialog), the object will receive
mouseUp/mouseLeave/etc.

3) The easiest way to handle this is to have a semaphore

local MSD

on mouseDown
   put false into MSD
end mouseDown

on mouseUp
   if MSD then exit mouseUp
end mouseUp

on mouseStillDown
   put true into MSD
end mouseStillDown


-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list