pub enum Event<D: TimeDuration, I: TimeInstant<Duration = D>> {
Press {
at: I,
},
Release {
duration: D,
click_follows: bool,
},
Click {
count: u8,
},
Hold {
clicks_before: u8,
level: u8,
},
}Expand description
A button event produced by the state machine.
Variants§
Press
The button was pressed. Fires immediately on press edge.
at is the timestamp of the press, identical to what
crate::ButtHead::press_instant returns during the pressed state.
Fields
at: IRelease
The button was released. duration is the total time it was held.
click_follows is true when a Event::Click will follow (the
release ends a click gesture), and false when it ends a hold gesture.
Click
A complete click gesture (press + release, no hold).
count starts at 1. Fires once after click_timeout expires with no
further press. A double-click produces a single Click { count: 2 }.
Hold
The button is being held. Fires repeatedly at a configured interval.
clicks_before is the number of clicks that preceded this hold
(0 = plain hold, 1 = click+hold, 2 = double-click+hold, …).
level increments on each repeat (0 = first hold event, 1 = second, …).