You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lance A. Endres edited this page Mar 23, 2025
·
4 revisions
Introduction
The ButtonSuite breaks a button press sequence down into various events in the ButtonBase::update() function. Below is a guide to help visualize when each of these events occurs.
There are two main types of button presses, short presses and long presses. They are divided by the _longPressInterval member in ButtonBase. If a derived class wants to use long press functionality, they should expose a function to set the long press interval.
The following image is a legend for the other figures.
Short Press Sequence
The following is the sequence of events detected during short presses of a button.
Long Press Sequence
The following is the sequence of events detected during long presses of a button. Note that after a button is pressed down, there is an interval where ISSHORTPRESSED is returned. This is because it cannot be determined at this point that a long press is intended. Only once the long press interval has expired is ISLONGPRESSED returned.