2022-05-23 5: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 4: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 5:57 AM
So you just need to watch the PRESSED and RELEASED events, and act accordingly on each.
2022-05-27 7:39 AM
2022-05-27 8: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
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