Skip to main content
TJone
Visitor II
November 27, 2018
Solved

What causes the touchgfx framework to generate a button cancel event?

  • November 27, 2018
  • 1 reply
  • 709 views

We have incorporated a new touchscreen into our product and the button press and release events seem to be generated at the correct times. If I hold my finger on the button I receive a number of cancel events in between the press and release.

I put in some debugging code and verified that my sampleTouch method is returning true and filling in the correct screen coordinates on each call while my finger remains on the button. I can't determine why the cancel events are being generated.

Any guidance you could provide would be appreciated.

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Hi @TJone​,,

Missed this question. Basically, the only reason a cancel event would be generated is if your touch controller implementation returns some coordinate outside of the buttons area (e.g. You're not releasing, but simply cancelling your press). If the Touch Controller implementation would return false for some reason (no press) even if your finger was on the button, you would receive a RELEASED event.

Hope this helps a bit.

Best regards,

Martin

1 reply

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
January 13, 2019

Hi @TJone​,,

Missed this question. Basically, the only reason a cancel event would be generated is if your touch controller implementation returns some coordinate outside of the buttons area (e.g. You're not releasing, but simply cancelling your press). If the Touch Controller implementation would return false for some reason (no press) even if your finger was on the button, you would receive a RELEASED event.

Hope this helps a bit.

Best regards,

Martin