cancel
Showing results for 
Search instead for 
Did you mean: 

How do I override a ClickEvent to double-click?

Zwei.9
Associate III
 
1 ACCEPTED SOLUTION

Accepted Solutions
Romain DIELEMAN
ST Employee

Hi, I would personally use the tickEvent: when the button is clicked (in reality the clickEvent is called when the button is is released) you start a tick counter. One tick is 16.6 ms (60Hz). Then if the same button has been clicked again before a set number of ticks you activate whatever function you wish to do.

/Romain

View solution in original post

2 REPLIES 2
Romain DIELEMAN
ST Employee

Hi, I would personally use the tickEvent: when the button is clicked (in reality the clickEvent is called when the button is is released) you start a tick counter. One tick is 16.6 ms (60Hz). Then if the same button has been clicked again before a set number of ticks you activate whatever function you wish to do.

/Romain

Romain DIELEMAN
ST Employee

The tick should be always the same. However I have encountered some "lagging" events when using complex operations with some of the less powerful MCUs. Depending on your projects this is negligible. If you have this issue and need to be extremely precise tell us. I know another solution exists to have a better tick but I am not aware of how to use it. I have read it in another post, I will try to link it here.