Skip to main content
Associate II
May 29, 2025
Question

Redrawing is not happening on the UI when expecting from a hardware button press.

  • May 29, 2025
  • 3 replies
  • 680 views

Hi everyone,

I’m running into a strange rendering issue in TouchGFX and could use your insights.

What I’m Seeing

  • I have a function that hides or shows several UI elements (e.g. buttons) and then calls invalidate() on them.

  • When I invoke this function from a touch button, everything works as expected: the elements disappear from the screen.

  • However, when I call the exact same function from my hardware-button within (handleKeyEvent()), the elements become non-interactive (I can’t touch them) but they remain visible on screen.

What I’ve Confirmed

  1. The function is definitely being executed (the elements lose touchability) it means changes have applied.

  2. I’m correctly calling element.invalidate() (and even invalidating the parent container).

  3. If I defer the call using a flag and perform the update in handleTickEvent(), it works reliably. but I believe it is not a good approach.

What I’ve Tried

  • Calling the function via touchgfx::Callback<>

  • Triggering it with an “Action” in the Designer

Every approach applies the logical state change, but the visual update only appears when triggered by a UI button.

How can i solve this and what could be the possible issue here.

3 replies

ST Employee
June 2, 2025

Hello @AnanD55_kmwt,

Have you tried to do invalidations also before calling all the set-visible functions ?

BR,

Associate II
June 3, 2025

Yes, But It didn't work.

ST Employee
June 3, 2025

You have this issue on target or on simulator ?
Have you tried to Debug your app in the simulator ? You can highlight the invalidated area and run the app tick by tick Simulator | TouchGFX Documentation.
Before hand set up the hardware button to a value that is mapped to your keyboard (Check the interaction tab in the designer).

BR,

Associate II
June 4, 2025

The issue is on target and since I have mapped the hardware button with the value which is not mapped with the keyboard I didnt test on the simulator.

 

ST Employee
June 6, 2025

You can try to debug it on target so you can check the whole call stack when using a hardware button and touch, to see what differs.