Set DoubleClickInterval very low!

Richard Gaskin ambassador at fourthworld.com
Thu Aug 4 14:41:11 EDT 2016


Sannyasin Brahmanathaswami wrote:

> It's very simple:
>
> on mouseup
>    # do something right now and don't wait more than 100 milliseconds
>    # because we don't use double clicks anywhere in this app
> end mouseup
>
> There is no "dual model" to even think about.

If you have no interest in double-clicks it's even simpler:






(nothing, since no special handling is needed for events not handled)

> Jacqueline: can you supply a small "long press" trap snippet for us here? tks

FWIW here's the one I've been using in my lib:


on touchStart pTouchID
    put the millisecs into             sTouchEventsA[pTouchID]["start"]
    put the long id of the target into sTouchEventsA[pTouchID]["target"]
    send "_TestLongPress" && pTouchID to me in kLongPressDuration millisecs
    pass touchStart
end touchStart

on touchEnd pTouchID
    delete variable sTouchEventsA[pTouchID]
    pass touchEnd
end touchEnd

on _TestLongPress pTouchID
    put sTouchEventsA[pTouchID]["start"] into tStart
    if tStart is empty then exit _TestLongPress
    put sTouchEventsA[pTouchID]["target"] into tObj
    if there is a tObj then
       dispatch "longPress" to tObj
    end if
end _TestLongPress


-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for Desktop, Mobile, and Web
  ____________________________________________________________
  Ambassador at FourthWorld.com        http://www.FourthWorld.com




More information about the use-livecode mailing list