pub enum Event<D: TimeDuration> {
Press,
Release {
duration: D,
},
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.
Release
The button was released. duration is the total time it was held.
Fields
§
duration: DClick
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, …).
Trait Implementations§
impl<D: Copy + TimeDuration> Copy for Event<D>
impl<D: Eq + TimeDuration> Eq for Event<D>
impl<D: TimeDuration> StructuralPartialEq for Event<D>
Auto Trait Implementations§
impl<D> Freeze for Event<D>where
D: Freeze,
impl<D> RefUnwindSafe for Event<D>where
D: RefUnwindSafe,
impl<D> Send for Event<D>where
D: Send,
impl<D> Sync for Event<D>where
D: Sync,
impl<D> Unpin for Event<D>where
D: Unpin,
impl<D> UnsafeUnpin for Event<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for Event<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more