SetOnTouchSub


SetOnTouchSub onTouch()

Sets the on touch subroutine. Once set, the specified onTouch() subroutine will be automatically called when the screen is touched. The parameters work the same as the TouchEvent command.


Sub onTouch(action, index, x,y)

' Insert your code here

End Sub

action = 0

Touch Down

action = 1

Touch Up

action = 2

Touch Move

action = 3

Touch Cancel

action = 4

Touch outside UI area

action = 5

Touch Pointer Down (when there is more than one touch point)

action = 6

Touch Pointer Up (when there is more than one touch point)

The index indicates which point is being touched. This is used for multi-touch support.

The coordinates of the touch are stored in x and y.

Programs should always be prepared to handle Touch Cancel events and should tolerate anomalous situations such as receiving a new Touch Down without first having received a Touch Up for the prior gesture.


SetOnTouchSub Off

Turns off the automatic subroutine call.


Event Triggered Subs







Become a Patron