cancel
Showing results for 
Search instead for 
Did you mean: 

Can I Simulate a TouchGFX button click with ClickEvent? How?

Ajudi.1
Associate II

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.

0693W000008ydmQQAQ.pngEven 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

2 REPLIES 2
Alexandre RENOUX
Principal

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

ADow.1
Associate II

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