cancel
Showing results for 
Search instead for 
Did you mean: 

How does sampleTouch(..) can distinguish between touch clicks and long touches and swipes?

TNeub.1
Associate III

Im unsure how TouchGFX know if the current touch event is a "click" or a "long press" or a swipe - if it only gets the current position?

https://support.touchgfx.com/docs/api/classes/classtouchgfx_1_1_touch_controller#function-sampletouch

Do I need another functionality to accomplish long touches and swipe/drag&drop events?

1 REPLY 1
Tnguy.3
Associate III

I think you need to do if check on sample touch in the tick() and perform a counter if true, and that timer will determine if it's tap and release or tap and hold. As for the swipe, you can do a calculation of x when finger is first on the screen and difference it by x of when the finger is last on screen.