Closed cranefist closed 1 year ago
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.
Add getPressedMs() function in #124 Use this function in the DuringLongPress and LongPressStop events to get the time since the button was pressed.
getPressedTicks() Does not seem to exist?