Skip to main content
Visitor II
June 22, 2026
Question

External buttons TouchGFX

  • June 22, 2026
  • 1 reply
  • 24 views

I have 3 physical buttons: next, enter and previous. After next or previous clicked I have to move the frame which select the flex button on the screen. When I clicked the enter button selected button on the screen should be pressed and released. I mean the selected button should do what I set in TouchGFX Designer. How to simulate the real pressing on touch screen using physical button ? 

Also I have a container including the keyboard with the flex button. I would like to use the same approach.

1 reply

ST Technical Moderator
June 29, 2026

Hello ​@Gelikan.

The handleKeyEvent function built into TouchGFX only handles the case where a button is either pressed or released, depending on your button controller implementation. Therefore, as I see it, you have two obvious options:

1. Implement a button controller that emits different ASCII values based on whether the button is pressed or released. However, to avoid emitting an event on every tick when the button is simply released, I would recommend adding a flag in the button controller so that you only emit one event per button state change.

2. Implement the functionality in Model.cpp and emit the button state to the view through the ModelListener. You can either poll it in Model::tick or make it interrupt-based.

For both options, once the event reaches the view, you should create a click event on the associated button using the ClickEvent class.

Let me know if it makes sense.

Best regards,
Johan