ButtonDebouncer class final
Turns raw hardware-button events into single presses.
Many UVC cameras report both press (state 1) and release (state 0), and some bounce, reporting several presses per click. Only presses are passed on, and presses within window of the previous one are dropped.
Constructors
- ButtonDebouncer({Duration window = const Duration(milliseconds: 700), DateTime clock()?})
- Creates a debouncer.
Properties
Methods
-
accept(
int state) → bool -
Returns whether a raw event with
statecounts as a new press. -
bind(
Stream< int> states) → Stream<void> - Applies accept to a stream of raw button states.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited