Distinguishing between tap and swipe

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Distinguishing between tap and swipe

Alejandro Tejada via use-livecode
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.

BR


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Distinguishing between tap and swipe

Alejandro Tejada via use-livecode
Hi BR,

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

on mouseDown
   put the short name of target into tTargetFieldToClear
   put item 1 the mouseLoc into tStartLocX
end mouseDown

on mouseUp
   lock screen

   put item 1 the mouseLoc into tEndLocX

   if tEndLocX + 10 < tStartLocX then
      put empty into target
   end if

   unlock screen
end mouseUp

be well,
randy
www.classroomFocusedSoftware.com


> On Mar 9, 2017, at 11:12 PM, Sannyasin Brahmanathaswami via use-livecode <[hidden email]> 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.
>
> BR
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Distinguishing between tap and swipe

Alejandro Tejada via use-livecode
Whe the +10? Tolerance?

Bob S


> On Mar 10, 2017, at 05:36 , Randy Hengst via use-livecode <[hidden email]> wrote:
>
> Hi BR,
>
> 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
>
> on mouseDown
>   put the short name of target into tTargetFieldToClear
>   put item 1 the mouseLoc into tStartLocX
> end mouseDown
>
> on mouseUp
>   lock screen
>
>   put item 1 the mouseLoc into tEndLocX
>
>   if tEndLocX + 10 < tStartLocX then
>      put empty into target
>   end if
>
>   unlock screen
> end mouseUp
>
> be well,
> randy

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Distinguishing between tap and swipe

Alejandro Tejada via use-livecode
@ Bob I'm using 10 also, based on using lower numbers and watching users who tap rows in a list (which serve as buttons)  expect it to "trigger" instead of scroll the list… if that is what you mean by "tolerance"   I could be wrong and there are probably more experienced UX devs out there who know better, but it seems very rare that someone using a swipe up or to the right or left to scroll, ever does it with a gesture that is lower than 10 px

But I doubt if that value affects performance.

BR

@ randy: I see if I can use your method… will let us know if it helps.
 

On 3/10/17, 5:53 AM, "use-livecode on behalf of Bob Sneidar via use-livecode" <[hidden email] on behalf of [hidden email]> wrote:

    Whe the +10? Tolerance?
   
    Bob S

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...