Distinguishing between tap and swipe
iowahengst at mac.com
Fri Mar 10 08:36:48 EST 2017
I’ve not used swipe a lot, but here is how I have used it to “erase” from a text field… the app is iOS iPad only. Below is the script of the text field. It works quickly without a noticeable delay.
local tStartLocX, tEndLocX
put the short name of target into tTargetFieldToClear
put item 1 the mouseLoc into tStartLocX
put item 1 the mouseLoc into tEndLocX
if tEndLocX + 10 < tStartLocX then
put empty into target
> On Mar 9, 2017, at 11:12 PM, Sannyasin Brahmanathaswami via use-livecode <use-livecode at lists.runrev.com> wrote:
> Mobile: To distinquish tap from swipe, I'm using the abs of the difference of the mouseloc on mousedown and mouseup….
> private function _mouseMoved
> put abs (the mouseV - item 2 of sStartLoc) into someDistance
> put someDistance >= 10 into someBoolean
> return someBoolean
> end _mouseMoved
> But this is quite "sluggish" on the any phone, meanwhile any straight forward
> on mouseup
> do something
> end mouseup
> is quite snappy.
> Is there a better way to trap for swipe and immediately trigger a tap.
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode