cancel
Showing results for 
Search instead for 
Did you mean: 

[TouchGFX]How to use the Trigger "Hardware button is clicked"

Wrend.1
Senior

I want to use the Interaction function "Hardware button is clicked" ​.

Can it work in PC simulation? Like i press 'w' on the keyboard of PC,and it call a function.

Is there an example program for it.

1 ACCEPTED SOLUTION

Accepted Solutions
MM..1
Chief II

Simply as on image and in code you can call it in model example down

0693W000004GVPPQA4.jpg 

if ((HAL_GPIO_ReadPin(SW3_GPIO_Port, SW3_Pin) == GPIO_PIN_RESET && filter == false) ) // any gpio button check

 {

  filter = true;

  static_cast<FrontendApplication*>(Application::getInstance())->handleKeyEvent(88); // keycode from image send

 }

In simulator you can use key 88 X on pc keyboard

View solution in original post

2 REPLIES 2
MM..1
Chief II

Simply as on image and in code you can call it in model example down

0693W000004GVPPQA4.jpg 

if ((HAL_GPIO_ReadPin(SW3_GPIO_Port, SW3_Pin) == GPIO_PIN_RESET && filter == false) ) // any gpio button check

 {

  filter = true;

  static_cast<FrontendApplication*>(Application::getInstance())->handleKeyEvent(88); // keycode from image send

 }

In simulator you can use key 88 X on pc keyboard

Thanks,I try it and it works.