Skip to main content
TNeub.1
Associate III
November 3, 2021
Question

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

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?

This topic has been closed for replies.

1 reply

Tnguy.3
Associate II
November 10, 2021

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.