AceButton
1.6.1
An adjustable, compact, event-driven button library for Arduino.
|
A subclass of ButtonConfig which allows the user to override the varous timing parameters of ButtonConfig at runtime. More...
#include <AdjustableButtonConfig.h>
Additional Inherited Members | |
![]() | |
typedef uint16_t | FeatureFlagType |
Type of the feature flag. More... | |
typedef void(* | EventHandler) (AceButton *button, uint8_t eventType, uint8_t buttonState) |
The event handler signature. More... | |
![]() | |
ButtonConfig ()=default | |
Constructor. | |
virtual | ~ButtonConfig ()=default |
If the ButtonConfig is created and deleted on the heap, a virtual destructor is technically required by the C++ language to prevent memory leaks. More... | |
uint16_t | getDebounceDelay () const |
Milliseconds to wait for debouncing. | |
uint16_t | getClickDelay () const |
Milliseconds to wait for a possible click. | |
uint16_t | getDoubleClickDelay () const |
Milliseconds between the first and second click to register as a double-click. | |
uint16_t | getLongPressDelay () const |
Milliseconds for a long press event. | |
uint16_t | getRepeatPressDelay () const |
Milliseconds that a button needs to be Pressed down before the start of the sequence of RepeatPressed events. More... | |
uint16_t | getRepeatPressInterval () const |
Milliseconds between two successive RepeatPressed events. | |
void | setDebounceDelay (uint16_t debounceDelay) |
Set the debounceDelay. | |
void | setClickDelay (uint16_t clickDelay) |
Set the clickDelay. | |
void | setDoubleClickDelay (uint16_t doubleClickDelay) |
Set the doubleClickDelay. | |
void | setLongPressDelay (uint16_t longPressDelay) |
Set the longPressDelay. | |
void | setRepeatPressDelay (uint16_t repeatPressDelay) |
Set the repeatPressDelay. | |
void | setRepeatPressInterval (uint16_t repeatPressInterval) |
Set the repeatPressInterval. | |
virtual unsigned long | getClock () |
Return the milliseconds of the internal clock. More... | |
virtual int | readButton (uint8_t pin) |
Return the HIGH or LOW state of the button. More... | |
bool | isFeature (FeatureFlagType features) const |
Check if the given features are enabled. | |
void | setFeature (FeatureFlagType features) |
Enable the given features. | |
void | clearFeature (FeatureFlagType features) |
Disable the given features. | |
void | resetFeatures () |
Disable all (externally visible) features. More... | |
EventHandler | getEventHandler () const DEPRECATED |
Return the eventHandler function pointer. More... | |
void | dispatchEvent (AceButton *button, uint8_t eventType, uint8_t buttonState) const |
Dispatch the event to the handler. More... | |
void | setEventHandler (EventHandler eventHandler) |
Install the EventHandler function pointer. More... | |
void | setIEventHandler (IEventHandler *eventHandler) |
Install the IEventHandler object pointer. More... | |
![]() | |
static ButtonConfig * | getSystemButtonConfig () |
Return a pointer to the singleton instance of the ButtonConfig which is attached to all AceButton instances by default. | |
![]() | |
static const uint16_t | kDebounceDelay = 20 |
Default value returned by getDebounceDelay(). | |
static const uint16_t | kClickDelay = 200 |
Default value returned by getClickDelay(). | |
static const uint16_t | kDoubleClickDelay = 400 |
Default value returned by getDoubleClickDelay(). | |
static const uint16_t | kLongPressDelay = 1000 |
Default value returned by getLongPressDelay(). | |
static const uint16_t | kRepeatPressDelay = 1000 |
Default value returned by getRepeatPressDelay(). | |
static const uint16_t | kRepeatPressInterval = 200 |
Default value returned by getRepeatPressInterval(). | |
static const FeatureFlagType | kFeatureClick = 0x01 |
Flag to activate the AceButton::kEventClicked event. | |
static const FeatureFlagType | kFeatureDoubleClick = 0x02 |
Flag to activate the AceButton::kEventDoubleClicked event. More... | |
static const FeatureFlagType | kFeatureLongPress = 0x04 |
Flag to activate the AceButton::kEventLongPress event. | |
static const FeatureFlagType | kFeatureRepeatPress = 0x08 |
Flag to activate the AceButton::kEventRepeatPressed event. | |
static const FeatureFlagType | kFeatureSuppressAfterClick = 0x10 |
Flag to suppress kEventReleased after a kEventClicked. | |
static const FeatureFlagType | kFeatureSuppressAfterDoubleClick = 0x20 |
Flag to suppress kEventReleased after a kEventDoubleClicked. More... | |
static const FeatureFlagType | kFeatureSuppressAfterLongPress = 0x40 |
Flag to suppress kEventReleased after a kEventLongPressed. | |
static const FeatureFlagType | kFeatureSuppressAfterRepeatPress = 0x80 |
Flag to suppress kEventReleased after a kEventRepeatPressed. | |
static const FeatureFlagType | kFeatureSuppressClickBeforeDoubleClick = 0x100 |
Flag to suppress kEventClicked before a kEventDoubleClicked. More... | |
static const FeatureFlagType | kInternalFeatureIEventHandler = 0x8000 |
Internal flag to indicate that mEventHandler is an IEventHandler object pointer instead of an EventHandler function pointer. | |
static const FeatureFlagType | kFeatureSuppressAll |
Convenience flag to suppress all suppressions. More... | |
A subclass of ButtonConfig which allows the user to override the varous timing parameters of ButtonConfig at runtime.
Each timing parameter is stored in a member variable, so an instance of AdjustableButtonConfig consumes far more static RAM than ButtonConfig. In return, this class allows these parameters to be changed at runtime by the user.
Warning: This class is deprecated and replaced with its parent ButtonConfig class. You can just use ButtonConfig everywhere you previously used AdjustableButtonConfig.
Definition at line 43 of file AdjustableButtonConfig.h.