Hardware Button
Hello, I have been trying for 2 days to read my hardware button from the STM32F746G board and change the color on the display. Unfortunately, all tutorials are for older versions where the file ButtonController.hpp still exists, but in TouchGFX 4.21.1 this file is not generated. The button is set up as BTN_USER with a pull-down in Cube MX. In the .touchgfx file, I have added
"PhysicalButtons": [ { "Key": 1, "Name": "BTN_USER" } ],
I also cannot manually call Screen1ViewBase::handleKeyEvent(uint8_t key) because I always get include errors. It can't be that difficult to read a physical button.
Screen1ViewBase.cpp:
void Screen1ViewBase::handleKeyEvent(uint8_t key)
{
if(1 == key) { //Interaction1 //When hardware button 1 clicked change color of box1 //Set RGB color R:255, G:0, B:0 on box1 box1.setColor(touchgfx::Color::getColorFromRGB(255, 0, 0)); box1.invalidate();
