-
Notifications
You must be signed in to change notification settings - Fork 1
Button Events
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.
The following is the sequence of events detected during short presses of a button.
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.