Skip to main content
Zwei.9
Associate III
February 20, 2020
Solved

How do I override a ClickEvent to double-click?

  • February 20, 2020
  • 2 replies
  • 959 views

..

This topic has been closed for replies.
Best answer by Romain DIELEMAN

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

2 replies

Romain DIELEMAN
Romain DIELEMANBest answer
ST Employee
February 20, 2020

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
February 20, 2020

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.