cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get different touch states or gestures like up, down or pressed?

MVils.1
Associate II

I implemented the sampleTouch function and so far it's possible to click a gui button. I tried touchgfx examples where you can press a button and it stays in pressed state. In my project every sampleTouch call gives a single touch event. Also drag is not working.

Would it be possible to create custom touch events?

4 REPLIES 4
Alexandre RENOUX
Principal

Hello,

The DragEvent is based on the sampleTouch. If it does not work it means your sampleTouch() function is not working properly. This can be caused by a wrong initialization of the i2c interface for instance (if your screen communication protocol is I2C of course).

sampleTouch() is called every tick. TouchGFX retrieves this data and will create a drag event according to the data it receives.

On what board are you working ?

/Alexandre

Our screen has a seperate touch controller (mxt640u). Board is a stm32429-eval1. Communication via I2C is working. x/y data is passed to the parameters in the sampleTouch function and it's returning true if the panel is touched.

If I hold my finger on a button it gets constantly toggled. I expect it to stay in "pressed-mode" unitl release.

Thanks for your help

This issue with having your finger on a button and it gets constantly toggled is typically a TouchController issue or its interface at least. TouchGFX only works on what it receives. Are you sure, you receive every touch events ? Is your touchController able to update the coordinates at 60 Hz ?

/Alexandre

MVils.1
Associate II

You are right, my sampleTouch function is not always returning true while the touch happens. I have to investigate this for now.

Thank you