2022-05-23 05:48 AM
How do we know if our hand is on the button? e.g; If our hand is on a button, the led is always on, if we raise our hand over that button, the led turns off.
2022-05-25 04:54 AM
Hi Andrew Neil,
I did work this application. But I need a little different. I need as in the video below. It will work as long as the button is pressed, and it will not work when I take my hand off the button. For example; When my hand is pressed on the button, the led will turn on, but when I take my hand off the button, the led will turn off.
What I want to do is, as long as my hand is pressed on the button, the numbers will increase, but when I take my hand off the button, the numbers will not increase.
I've been trying to solve this problem for a few days
2022-05-25 05:57 AM
So you just need to watch the PRESSED and RELEASED events, and act accordingly on each.
2022-05-27 07:39 AM
2022-05-27 08:10 AM
What, exactly, does "doesn't work" mean?
What debugging have you done to find out what's happening?
2022-05-29 10:56 PM
It works in the simulator environment, but it doesn't work properly on my board. While my hand is on the button, it has to continuously increase the number, but it does not do it.
I have attached two videos showing how it works both in the simulator and on my board. You can look there.
2022-05-29 10:58 PM
2022-05-29 11:59 PM
Hello Freedom_Neo,
In your videos, your UIs are not the same on your simulator and your board. Is t still the same application ?
Also, the question is already answered here :
https://community.st.com/s/question/0D50X0000CBl0asSQB/long-touch-detect-on-stm32l4r9aieval
and here : https://community.st.com/s/question/0D53W00001YdFteSAF/long-press-button-increment-fast-value
As Alexandre RENOUX said, you have to create a new class for your custom button because the standard Button class in TouchGFX only triggers on clicked. So in your Designer, do not use a Button widget.
There's also another solution given by RGajd.1. Have you tried this one ?
Try to investigate a bit more about how to create your own custom buttons, and let us know if you need help on doing it :)
/Osman