2021-04-03 10:30 AM
I am trying to "press" a button without actually touching the touchscreen of my development board.
Reading the TouchGFX documentation, I found that there is a method called
ClickEvent, that seems like it might do the trick.
I tried calling the following:
// ClickEvent(ClickEventType type, int16_t x, int16_t y, int16_t force =0)
ClickEvent(ClickEvent::PRESSED,396,420);
The X and Y coordinates were obtained from TouchGFX Designer, as you can see in the following image.
Even though it compiles, I can't seem to get this to work.
I am not sure if I am using this the correct way, or maybe there is another way generating a click.
PD: I am using TouchGFX version 4.13
Thanks
2021-04-05 11:53 PM
Hello Ajudi.1,
ClickEvent is linked to your touchscreen so it's not the right way to do in my opinion.
What do you mean by trying to "press" a button without actually touching the touchscreen ? Are you trying to use hardware buttons ?
/Alexandre
2021-11-03 12:03 AM
Hi Ajudi.1,
I'm not sure if you're still having that problem, but something like this may help:
ClickEvent ev = ClickEvent(ClickEvent::RELEASED,396,420);
flexButton1.setPressed(true);
flexButton1.handleClickEvent(ev);
or you can have the first 'click' be of type PRESSED and another 'click' to be "RELEASED"
/Abeer