2025-12-02 11:49 PM
Hello,
I developed a product,
but customer wants that if no touch detected in 10 seconds the device will go in home page.
I believe that the only way is to manage STM32TouchController.cpp in the point I have higlighted
Is it the best way ?
Thankyou for your patience.
Solved! Go to Solution.
2025-12-11 2:14 AM
The execution rate of handleTickEvent() is actually determined by how you tick the application. TouchGFX is designed to operate at 60 Hz by default, which is why I assumed 60 Hz in the code snippet.
You are correct that the generation of the screen transition code needs to be triggered, e.g. as shown in your screenshot.
You can use getCurrentScreen(), which returns a pointer to the currently displayed screen: https://support.touchgfx.com/docs/api/classes/classtouchgfx_1_1_application#getcurrentscreen.
Another option is to manually save the current screen in the model, e.g. every time a screen constructor is entered.
Best regards,
Johan
2025-12-04 4:16 AM
Hello @MauFanGilaMedical.
I believe a better solution would be to implement it in FrontendApplication. E.g. by doing something like this:
void FrontendApplication::handleTickEvent()
{
model.tick();
FrontendApplicationBase::handleTickEvent();
idleTickCounter++;
if (idleTickCounter == 10 * 60)
{
gotoHomeScreenNoTransition();
}
}
void FrontendApplication::handleClickEvent(const ClickEvent& evt)
{
FrontendApplicationBase::handleClickEvent(evt);
idleTickCounter = 0;
}
Best regards,
Johan
2025-12-10 12:00 AM - edited 2025-12-10 12:04 AM
OK: but I deduce that
handleTickEvent
is executed at 60fps.
But to have
gotoHomeScreenNoTransition();
I have to add interaction like in the picture below, right ?
And there is a way to deduce what is the current display screen ? Because I have to go Home if I am in screens different from Home, Power on and Power off
2025-12-11 2:14 AM
The execution rate of handleTickEvent() is actually determined by how you tick the application. TouchGFX is designed to operate at 60 Hz by default, which is why I assumed 60 Hz in the code snippet.
You are correct that the generation of the screen transition code needs to be triggered, e.g. as shown in your screenshot.
You can use getCurrentScreen(), which returns a pointer to the currently displayed screen: https://support.touchgfx.com/docs/api/classes/classtouchgfx_1_1_application#getcurrentscreen.
Another option is to manually save the current screen in the model, e.g. every time a screen constructor is entered.
Best regards,
Johan