cancel
Showing results for 
Search instead for 
Did you mean: 

Hardware button with TouchGFX for screen transition

Josh_W020
Associate

Hi,

I have been trying to implement the functionality to change the currently active screen on TouchGFX using a hardware button with no luck so far.

I'm using an STM32H743zit6.

Here are the resources I've looked at but haven't managed to get working:

https://www.youtube.com/watch?v=ufvJ5bcesL8

https://www.youtube.com/watch?v=QgEDSjvGAlk

https://support.touchgfx.com/docs/development/scenarios/example-gpio

https://support.touchgfx.com/docs/development/board-bring-up/how-to/10-physical-buttons

https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/screen-transitions

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/hardware-button/td-p/640357

 

Any help would be greatly appreciated,

Thanks.

12 REPLIES 12

Hi,

I have tried implementing as you said:

#include <gui/common/FrontendApplication.hpp>

Model::Model() : modelListener(0)
{

}

void Model::tick()
{
    if (HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_2) == GPIO_PIN_RESET)
    {
        static_cast<FrontendApplication*>(Application::getInstance())->handleKeyEvent('A');
    }
}

But still have had no luck with it. Thanks for the suggestion though, I think that using handle key event to make it think I've pressed the 'A' key is a good way to do it. Just unsure why it hasn't worked in this case.

Hi,

Thanks for the response.

Is the MB1642ButtonController.cpp a file that you have created or one that is generated?

the reason I ask is that in my project I have ButtonController.hpp generated but don't have a file called ButtonController.cpp

Kind Regards,

Josh

Are you sure, you have on active screen created Interaction for handle A key , that start transition to next screen?

Next point is in debuger test if tick is realy executed and not blocked ...