Sub myButton(ViewTag As Object, Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean
Select Case Action
Case 0: 'Press
'code here when the button is pressed ("down" equivalent)
Case 1: 'Release
'code here when the button is released ("up" equivalent)
End Select
End Sub