ButtonHandler
Handles button state updates and provides methods for detecting various button events.
Parameters
doubleTapThreshold
the maximum time (ms) between two presses to count as a double tap
debounceThreshold
the minimum time (ms) between state changes to prevent bouncing