You should follow the structure of Model-View-Presenter, e.g.
- get the status of the hardware button outside of TouchGFX within main.c, e.g. via interrupt and a callback routine setting a global variable
- model.hpp: declare this variable (extern)
- model.cpp:
- check this variable e.g. in the function model::tick() which gets called at the framerate of appr. 60Hz
- call the virtual function of the modellistener which handles the button accordingly
- modellistener.hpp: declare a virtual function, which handles the button
- xyzPresenter.hpp: declare the same virtual function, which handles the button
- xyzPresenter.cpp: define the function, which handles the button
The latter function in presenter.cpp might call e.g.:
static_cast<FrontendApplication*>(Application::getInstance())->goto_yourscreen_ScreenCoverTransitionEast();
When your question is answered, please close this topic by choosing Select as Best.
/Peter
In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.