cancel mouseUp?
Posted: Sat Mar 09, 2013 12:43 am
Hi,
I am setting up some "swipe" actions in one of my Apps and I am wondering how can I "Cancel" the mouseUp message if I have determined a "swipe" has occurred.
Note- The below code is working but I am not canceling the mouseUp message which makes me nervous (although the mouseUp handler doesn't run if the swipe condition is met.....)
I am setting up some "swipe" actions in one of my Apps and I am wondering how can I "Cancel" the mouseUp message if I have determined a "swipe" has occurred.
Note- The below code is working but I am not canceling the mouseUp message which makes me nervous (although the mouseUp handler doesn't run if the swipe condition is met.....)
Code: Select all
on touchStart
put the tmMenuHistory of me into lFigure
end touchStart
on touchMove pId, pX, pY
if pId <> sTouchId then
-- record initial values for start of swipe
put pId into sTouchId
put the millisecs into sInitTime
put pX into sInitX
end if
-- check the action was fast enough for a swipe
if the millisecs - sInitTime <= sSwipeTime then
# check we have covered enough distance
put pX - sInitX into tDistanceX
if abs(tDistanceX) > sSwipeDistance then
send "insertBreakPoint lFigure" to me in 0 millisecs
end if
end if
end touchMove
on mouseUp
answer "No Swipe, just a Tap"
end mouseUp