OneButton icon indicating copy to clipboard operation
OneButton copied to clipboard

getPressedTicks()

Open cranefist opened this issue 4 years ago • 1 comments

getPressedTicks() Does not seem to exist?

cranefist avatar Jun 07 '21 00:06 cranefist

I missed it too! I've added this to OneButton.h in the class definition, just between the isLongPressed() method and the private: keyword

  int getPressedTicks() { return(millis()-_startTime); };   // MaxintRD 211230: Added missing method

NOTE: unfortunately this method cannot be used in the handler for LongPressStop. By that time the variable_startTime has been reused. It can be used however in the handler of DuringLongPress, to see how long the button was pressed at that moment.

maxint-rd avatar Dec 31 '21 11:12 maxint-rd

Add getPressedMs() function in #124 Use this function in the DuringLongPress and LongPressStop events to get the time since the button was pressed.

IhorNehrutsa avatar May 11 '23 22:05 IhorNehrutsa

fixed by https://github.com/mathertel/OneButton/pull/124

mathertel avatar Jun 03 '23 18:06 mathertel