Skip to main content
Senior III
May 13, 2026
Solved

How to get click event type from flexButton callback

  • May 13, 2026
  • 1 reply
  • 135 views

I have a flexButton in a View, and I want to execute different functions depending on whether the button is PRESSED, RELEASED, or CANCEL.

I know you can create interaction in TouchGFX Designer, but you can only call a virtual function on click. Is there a way to, for instance, enable the clickListener Mixin to read the event that has fired the callback from that specific button?

I need to read this event within the view and relative to my button.

Is there a way, or do I have to create a custom widget?

Best answer by nico23

Ok, following this doc and using const touchgfx::ImageButtonStyle< touchgfx::ClickButtonTrigger >& button instead of const Box& b worked

1 reply

nico23AuthorAnswer
Senior III
May 13, 2026

Ok, following this doc and using const touchgfx::ImageButtonStyle< touchgfx::ClickButtonTrigger >& button instead of const Box& b worked