scsjc Well-Known Member Licensed User Longtime User Oct 17, 2016 #1 hello, is possible get a position from cursor on a Click ??? i'm use this code... OnTouch work ... but i need OnClick Code: Copy Dim r As Reflector r.Target = sv r.SetOnTouchListener("scvTest_Touch") . . . Sub scvTest_Touch(viewtag As Object, action As Int, X As Float, Y As Float, motionevent As Object) As Boolean Log(x) Log(Y) End Sub
hello, is possible get a position from cursor on a Click ??? i'm use this code... OnTouch work ... but i need OnClick Code: Copy Dim r As Reflector r.Target = sv r.SetOnTouchListener("scvTest_Touch") . . . Sub scvTest_Touch(viewtag As Object, action As Int, X As Float, Y As Float, motionevent As Object) As Boolean Log(x) Log(Y) End Sub
Erel B4X founder Staff member Licensed User Longtime User Oct 17, 2016 #2 Not directly. If you return False from this sub then the click event should be raised. You can store the coordiantes and check them in the Click event. Upvote 0
Not directly. If you return False from this sub then the click event should be raised. You can store the coordiantes and check them in the Click event.
scsjc Well-Known Member Licensed User Longtime User Oct 17, 2016 #3 Erel said: Not directly. If you return False from this sub then the click event should be raised. You can store the coordiantes and check them in the Click event. Click to expand... Hello, the problem is: if I click >>> not run a sub scvTest_Touch, only run when I move and touch screen And I need to run and get x and y when only a click touch screen Thanks !!! Upvote 0
Erel said: Not directly. If you return False from this sub then the click event should be raised. You can store the coordiantes and check them in the Click event. Click to expand... Hello, the problem is: if I click >>> not run a sub scvTest_Touch, only run when I move and touch screen And I need to run and get x and y when only a click touch screen Thanks !!!
Erel B4X founder Staff member Licensed User Longtime User Oct 18, 2016 #4 You can use the standard Touch event. Store the touch coordinates when action is DOWN and compare them to the coordinates when action is UP. If they are close enough then treat it as a click event. Upvote 0
You can use the standard Touch event. Store the touch coordinates when action is DOWN and compare them to the coordinates when action is UP. If they are close enough then treat it as a click event.
scsjc Well-Known Member Licensed User Longtime User Oct 18, 2016 #5 Erel said: You can use the standard Touch event. Store the touch coordinates when action is DOWN and compare them to the coordinates when action is UP. If they are close enough then treat it as a click event. Click to expand... Thanks... im try Upvote 0
Erel said: You can use the standard Touch event. Store the touch coordinates when action is DOWN and compare them to the coordinates when action is UP. If they are close enough then treat it as a click event. Click to expand... Thanks... im try