[−][src]Struct keebrs::debounce::Debouncer
Debouncer utility
Keeps track of key state and reports changes only after they've been debounced.
Implementations
impl<Sc, St, D> Debouncer<Sc, St, D> where
Sc: Scan,
St: State<Sc>,
D: FnMut(),
[src]
Sc: Scan,
St: State<Sc>,
D: FnMut(),
pub fn new(scanner: Sc, quick: bool, threshold: usize, delay: D) -> Self
[src]
Create a new debouncer from a scanner and debounce configuration
When quick
is true
, it wait threshold
scans after the first
change it sees to a key, and then read it again. If they key is still in
the state from the first change, it is considered changed and returned.
If not, then it's considered a spurious change and ignored.
When quick
is false
, it will wait until a key has been in the same
state for threshold
scans, and then report it as changed. In the event
of interference, this may report a key as changed to the same state it's
already in.
pub fn debounce_x(&mut self, x: usize) -> Option<(usize, KeyState)>
[src]
Scan an entire line and return any changed and debounced keys.
pub fn change_alg(&mut self, quick: bool)
[src]
Change the debouncing algorithm. May do weird things if called while debouncing is in progress.
Auto Trait Implementations
impl<Sc, St, D> Send for Debouncer<Sc, St, D> where
D: Send,
Sc: Send,
St: Send,
D: Send,
Sc: Send,
St: Send,
impl<Sc, St, D> Sync for Debouncer<Sc, St, D> where
D: Sync,
Sc: Sync,
St: Sync,
D: Sync,
Sc: Sync,
St: Sync,
impl<Sc, St, D> Unpin for Debouncer<Sc, St, D> where
D: Unpin,
Sc: Unpin,
St: Unpin,
D: Unpin,
Sc: Unpin,
St: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,