Skip to main content
Lagodolio
Associate III
December 4, 2019
Question

Clicked and released signal from the same button

  • December 4, 2019
  • 1 reply
  • 622 views

In TouchGFX it is possible to call a C function when a flexi button is clicked (Trigger "touch") or released (Trigger "clicked").

Is it possible that the same button calls an "I_m_pressed()" function when you stay button clicked AND sends an "I_m_released()" as you release it?

Thanks a lot!

This topic has been closed for replies.

1 reply

Martin KJELDSEN
Principal III
December 5, 2019

Hi,

I'm not 100% sure what you're asking, but - generally - you assign a handler to a button (A standard TouchGFX button - You could make your own with different arguments) and the event passed to that handler will tell you if it was a press or a release. There's no difference between a touch and a click.

ClickEventType is a part of the built in ClickEvent used for standard buttons classes.

 typedef enum
 {
 PRESSED, ///< An enum constant representing the pressed option
 RELEASED, ///< An enum constant representing the released option
 CANCEL ///< An enum constant representing the cancel option
 } ClickEventType;

/Martin