Skip to main content
Lagodolio
Associate III
February 8, 2021
Question

TouchGFX: where is the function that changes the button image?

  • February 8, 2021
  • 3 replies
  • 1236 views

In my previous post (Calling different functions when a button is pressed or released (Partially Solved): https://community.st.com/s/question/0D53W00000Wa1k2SAB/calling-different-functions-when-a-button-is-pressed-or-released-partially-solved ) I partially solved my problem by modifying the handlePressedUpdated() function.

But now I noticed a strange behavior: if I press/release the button all is OK, but if I press the button, swipe my finger out from the button area, and release, the button image become "unpressed" as soon I exit from the button area, but the "action on release" wasn't called.

I probably need to hook or modify the function that calls the changing of the button image by adding a function call, but I wasn't able to find that function (and I'm not sure it is the right way...).

Have a good day,

This topic has been closed for replies.

3 replies

MM..1
Chief III
February 8, 2021

I mean this is normal touch reaction when you swipe you dont click simply, then release is filtered.

Lagodolio
LagodolioAuthor
Associate III
February 8, 2021

The problem is not when I swipe from an external zone to the button zone, but when I click the button, move away and release: the physical (not "software") LED controlled by the button stay glow UP. 

Ok, but when I exit the button area, the button image switches from ON to OFF.

Well, I wish I "intercept" this signal to send the released button instruction also when you go out of the button zone to switching the LED off...

Lagodolio
LagodolioAuthor
Associate III
February 9, 2021

For the moment I adopt a "trivial" solution. I insert a "switch_off_all_LEDS()" directly in AbstractButtonContainer.hpp

virtual void handlePressedUpdated()
 {
 if (pressed==true)
 {
 	button_pressed=true;
 }
 else{
 	 button_pressed=false;
 	 switch_off_all_LEDS();
 }
 }

I'm looking for a better solution...