Skip to main content
MVils.1
Associate II
September 21, 2020
Question

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

  • September 21, 2020
  • 2 replies
  • 979 views

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?

This topic has been closed for replies.

2 replies

Alexandre RENOUX
Visitor II
September 21, 2020

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

MVils.1
MVils.1Author
Associate II
September 22, 2020

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

Alexandre RENOUX
Visitor II
September 23, 2020

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
MVils.1Author
Associate II
September 29, 2020

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

Thank you