cancel
Showing results for 
Search instead for 
Did you mean: 

Clicked and released signal from the same button

Lagodolio
Senior

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!

1 REPLY 1
Martin KJELDSEN
Chief III

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