[][src]Struct keebrs::debounce::Debouncer

pub struct Debouncer<Sc, St, D> { /* fields omitted */ }

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]

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

impl<Sc, St, D> Sync for Debouncer<Sc, St, D> where
    D: Sync,
    Sc: Sync,
    St: Sync

impl<Sc, St, D> Unpin for Debouncer<Sc, St, D> where
    D: Unpin,
    Sc: Unpin,
    St: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.