2024-06-27 06:45 AM
Hello everyone,
I am using TouchGFX 4.23.1 on STM32H750xx and I am experiencing this behaviour. I have a screen with multilple flexbuttons and each one of them has a callback setted when it is pressed. Everything works fine except I've noticed that the callback is called only after I release the button. So after reading TouchGFX's guidelines, I have tried the handleClickEvent method but then button's flexButtonCallbackHandler is not called. So those are the two methods:
1) void MyScreen::flexButtonCallbackHandler(const touchgfx::AbstractButtonContainer &flexButton) -> It works fine but it is called only after I release the button;
2) void MyScreen::flexButtonCallbackHandler(const touchgfx::AbstractButtonContainer &flexButton) + void MyScreen::handleClickEvent(const ClickEvent& evt) -> My application can sense immediately the touch in handleClickEvent but then flexButtonCallbackHandler is not called. So I am able to differentiate PRESSED or RELEASE but I am not able to understand which button is pressed.
In conclusion, I would like to have a method that could immediately call my callbacks after user's touch press (Differentiating the buttons callbacks)
Solved! Go to Solution.
2024-06-27 10:09 PM
Hello
Please check this thread
In the solution there is example how to compare the button addresses to regonize which button is pressed.
Hope this this helps you.
Br JTP
2024-06-27 10:09 PM
Hello
Please check this thread
In the solution there is example how to compare the button addresses to regonize which button is pressed.
Hope this this helps you.
Br JTP
2024-06-27 11:01 PM - edited 2024-06-27 11:06 PM
yes call back fuction will get trigger when youll release the button. but if you want to perfom some operation whenevr button is getting pressed then you should use this FlexButton.getPressed() in the void ScreenView::handleTickEvent()
2024-06-28 04:37 AM
Hello @JJhin.1 ,
I think you are looking for functionality that allows a task to continue as long as the button is pressed. In that case, your solution of checking the state of the flex button in handleTickEvent() is correct, because callbacks are triggered only once when an event occurs.
2024-06-30 05:15 AM
Thank you, it's what i am looking for.