Mobile Gestures

Mobile Gestures powers your projects LiveCode for mobile devices with the ability to handle some of the most common gestures. As they are the pinch the double touches and much more.

William de Smet - Jun 18th, 2020
Hi there, is there a sample stack with these Mobile Gestures?
Riko Abadi - May 8th, 2020
thanks

Mobile Gestures

Type

library

Description

This mini library is for some of the most common gestures we have on mobile devices.

PinchZoomingUp

Type

message

Syntax
PinchZoomingUp pPinchId, pRadio
Summary
Sent when a user pinches a control in a mobile application
Parameters
Name Type Description
pPinchId A number which uniquely identifies an individual physical pinch action from
a sequence of pinch messages.
pRadio Radius between two of the touches. The one who moves and any other.
Examples
on PinchZoomingUp pPinchId, pRadioOfTouches, pType
   if pPinchId is a number then
      # Script
   end if
end PinchZoomingUp
Description

Handle the PinchZoomingUp message if you want to take any action when the user pinches to zoom on the screen.

The PinchZoomingUp message is sent to the control which received the pinchStart message.

The pPinchID parameter is a number which uniquely identifies a sequence of pinch messages corresponding to an individual, physical pinch action. All such sequences start with a touchStart message, have one or more pinchMove messages and finish with either a pinchEnd.

TouchDoubleUp

Type

message

Syntax
TouchDoubleUp pTouchId
Summary
Sent when the user double-touch.
Parameters
Name Type Description
pTouchId A number which uniquely identifies an individual physical touch action from
a sequence of touch messages.
Examples
on TouchDoubleUp pTouchId
   if pTouchId is a number then
      # Script
   end if
end TouchDoubleUp
Description

Handle the TouchDoubleUp message to perform an action when the user double-touchs in mobile.

The TouchDoubleUp message is sent to the control that was double-touchs, or to the card if no control was under the touch point.
Note:This message is not sent if the user touches multiple screen points.

PinchRotate

Type

message

Syntax
PinchRotate pPinchId, pRotation
Summary
Sent when a user pinches a control in a mobile application
Parameters
Name Type Description
pPinchId A number which uniquely identifies an individual physical pinch action from
a sequence of pinch messages.
pRotation It is what has rotated the touches on the screen..
Examples
on PinchRotate pPinchId, pRadioOfTouches, pType
   if pPinchId is a number then
      # Script
   end if
end PinchRotate
Description

Handle the PinchRotate message if you want to take any action when the user pinches to rotate on the screen.

The PinchRotate message is sent to the control which received the pinchStart message.

The pPinchID parameter is a number which uniquely identifies a sequence of pinch messages corresponding to an individual, physical pinch action. All such sequences start with a touchStart message, have one or more pinchMove messages and finish with either a pinchEnd.

PinchEnd

Type

message

Syntax
PinchEnd pPinchId
Summary
Sent when a user pinches a control in a mobile application
Parameters
Name Type Description
pTouchId A number which uniquely identifies an individual physical pinch action from
a sequence of pinch messages.
Examples
on PinchEnd pPinchId
   if pPinchId is a number then
      # Script
   end if
end PinchEnd
Description

Handle the pinchEnd message to perform an action when the user finishes a pinch sequence.

The pinchEnd message is sent to the control that received the pinchStart message that started the touch sequence.

The pPinchId parameter is a number which uniquely identifies a sequence of pinch messages corresponding to an individual, physical touch action. All such sequences start with a PinchStart message, have one or more PinchMove messages and finish with either a PinchEnd message.

PinchZoomingDown

Type

message

Syntax
PinchZoomingDown pPinchId, pRadio
Summary
Sent when a user pinches a control in a mobile application
Parameters
Name Type Description
pPinchId A number which uniquely identifies an individual physical pinch action from
a sequence of pinch messages.
pRadio Radius between two of the touches. The one who moves and any other.
Examples
on PinchZoomingDown pPinchId, pRadioOfTouches, pType
   if pPinchId is a number then
      # Script
   end if
end PinchZoomingDown
Description

Handle the PinchZoomingDown message if you want to take any action when the user pinches to decrease on the screen.

The PinchZoomingDown message is sent to the control which received the pinchStart message.

The pPinchID parameter is a number which uniquely identifies a sequence of pinch messages corresponding to an individual, physical pinch action. All such sequences start with a touchStart message, have one or more pinchMove messages and finish with either a pinchEnd.

TouchDoubleDown

Type

message

Syntax
TouchDoubleDown pTouchId
Summary
Sent when the user double-touch.
Parameters
Name Type Description
pTouchId A number which uniquely identifies an individual physical touch action from
a sequence of touch messages.
Examples
on TouchDoubleDown pTouchId
   if pTouchId is a number then
      # Script
   end if
end TouchDoubleDown
Description

Handle The TouchDoubleDown message to perform an action when the user double-touch in mobile.

The TouchDoubleDown message is sent to the control that was double-touchs, or to the card if no control was under the touch point.
Note:This message is not sent if the user touches multiple screen points.

TouchVerySlow

Type

message

Syntax
TouchVerySlow  pTouchID, pDistance, pMoveAddress
Summary
It is sent when the point at which the user touches the screen changes in a certain time interval.
Parameters
Name Type Description
pTouchID a number that uniquely identifies an individual physical touch action of a sequence of touch messages.
pDistance the distance traveled by touch.
pMoveAddress Direction in which the touch moves for the last time
Examples
on TouchVerySlow pTouchID, pDistance, pMoveAddress
   put "fast touch. touch address is " &  pMoveAddress & " with a distance of " & pDistance & "px" into field 1
end TouchVerySlow
Description

Handle the TouchVerySlow message to perform an action when the user touch very slow object.

The TouchVerySlow message is sent to the control that received the touchStart message that initiated the touch sequence.

The pPinchId parameter is a number that uniquely identifies a sequence of touch messages corresponding to an individual physical touch action. All these sequences begin with a touchStart message, have one or more touchMove messages and end with a touchEnd message.

TouchStillDown

Type

message

Syntax
TouchStillDown pTouchId
Summary
Sent periodically while the touch is being held down.
Platforms
Parameters
Name Type Description
pTouchId A number which uniquely identifies an individual physical touch action from
a sequence of touch messages.
Examples
on TouchStillDown pTouchId
   if pTouchId is a number then
      # Script
   end if
end TouchStillDown
Description

You can handle the touchStillDown message to perform an action when the user holds the touch long time in screen.

The touchStillDown message is sent to the control that was originally clicked, or to the card if no control was under the touch.

TouchVeryFast

Type

message

Syntax
TouchVeryFast  pTouchID, pDistance, pMoveAddress
Summary
It is sent when the point at which the user touches the screen changes in a certain time interval.
Parameters
Name Type Description
pTouchID a number that uniquely identifies an individual physical touch action of a sequence of touch messages.
pDistance the distance traveled by touch.
pMoveAddress Direction in which the touch moves for the last time
Examples
on TouchVeryFast pTouchID, pDistance, pMoveAddress
   put "very fast touch. touch address is " &  pMoveAddress & " with a distance of " & pDistance & "px" into field 1
end TouchVeryFast
Description

Handle the TouchVeryFast message to perform an action when the user touch very fastan object.

The TouchVeryFast message is sent to the control that received the touchStart message that initiated the touch sequence.

The pPinchId parameter is a number that uniquely identifies a sequence of touch messages corresponding to an individual physical touch action. All these sequences begin with a touchStart message, have one or more touchMove messages and end with a touchEnd message.

PinchStart

Type

message

Syntax
PinchStart pTouchId
Summary
Sent when a user pinches a control in a mobile application
Parameters
Name Type Description
pTouchId A number which uniquely identifies an individual physical pinch action from
a sequence of pinch messages.
Examples
on PinchStart pPinchId
   if pPinchId is a number then
      # Script
   end if
end PinchStart
Description

Handle the PinchStart message to perform an action when the user touches the screen, starting the pinch.

The PinchStart message is sent to the control that was touched, or to the card if no control was under the pinch point.

The pPinchId parameter is a number which uniquely identifies a sequence of pinch messages corresponding to an individual, physical touch action. All such sequences start with a PinchStart message, have one or more PinchMove messages and finish with either a PinchEnd message.

No two pinch will have the same pPinchID, and it is possible to have multiple (interleaving) such sequences occurring at once. This allows handling of more than one physical pinch at once.

TouchSlow

Type

message

Syntax
TouchFast  pTouchID, pDistance, pMoveAddress
Summary
It is sent when the point at which the user touches the screen changes in a certain time interval.
Parameters
Name Type Description
pTouchID a number that uniquely identifies an individual physical touch action of a sequence of touch messages.
pDistance the distance traveled by touch.
pMoveAddress Direction in which the touch moves for the last time
Examples
on TouchFast pTouchID, pDistance, pMoveAddress
   put "fast touch. touch address is " &  pMoveAddress & " with a distance of " & pDistance & "px" into field 1
end TouchFast
Description

Handle the TouchFast message to perform an action when the user touch slow object.

The TouchFast message is sent to the control that received the touchStart message that initiated the touch sequence.

The pPinchId parameter is a number that uniquely identifies a sequence of touch messages corresponding to an individual physical touch action. All these sequences begin with a touchStart message, have one or more touchMove messages and end with a touchEnd message.

touchRelease

Type

command

Syntax
touchRelease pID
Summary
TOUCHDOUBLEUP
Description

TOUCHDOUBLEUP

_DispatchTouchDoubleDown

Type

command

Syntax
_DispatchTouchDoubleDown pTouchID
Summary
Angle between two points
Description

Angle between two points

touchEnd

Type

command

Syntax
touchEnd pTouchID
Summary
To know where I come from
Description

To know where I come from

TouchFast

Type

message

Syntax
TouchFast  pTouchID, pDistance, pMoveAddress
Summary
It is sent when the point at which the user touches the screen changes in a certain time interval.
Parameters
Name Type Description
pTouchID a number that uniquely identifies an individual physical touch action of a sequence of touch messages.
pDistance the distance traveled by touch.
pMoveAddress Direction in which the touch moves for the last time
Examples
on TouchFast pTouchID, pDistance, pMoveAddress
   put "fast touch. touch address is " &  pMoveAddress & " with a distance of " & pDistance & "px" into field 1
end TouchFast
Description

Handle the TouchFast message to perform an action when the user touch fastan object.

The TouchFast message is sent to the control that received the touchStart message that initiated the touch sequence.

The pPinchId parameter is a number that uniquely identifies a sequence of touch messages corresponding to an individual physical touch action. All these sequences begin with a touchStart message, have one or more touchMove messages and end with a touchEnd message.

PinchMove

Type

message

Syntax
PinchMove pPinchId, pRadio, pType
Summary
Sent when a user pinches a control in a mobile application
Parameters
Name Type Description
pPinchId A number which uniquely identifies an individual physical pinch action from
a sequence of pinch messages.
pRadio Radius between two of the touches. The one who moves and any other.
pType Type of pinch. Up (1), down (0) or simply by moving your fingers the same distance (null).
Examples
on PinchMove pPinchId, pRadioOfTouches, pType
   if pPinchId is a number then
      # Script
   end if
end PinchMove
Description

Handle the pinchMove message if you want to perform some action when the user changes the pinch position without ending the pinch or if you want to keep continuous track of the pinch position.

The pinchMove message is sent to the control which received the pinchStart message.

The pPinchID parameter is a number which uniquely identifies a sequence of pinch messages corresponding to an individual, physical pinch action. All such sequences start with a touchStart message, have one or more pinchMove messages and finish with either a pinchEnd.