pub struct InputState { /* private fields */ }Expand description
Mutable state carried across input events for double-tap detection.
Owned by the runtime; reset whenever focus moves to a selector / overlay (a fresh tap window starts after the selector closes).
Implementations§
Source§impl InputState
impl InputState
Sourcepub fn new(double_escape_action: DoubleEscapeAction) -> Self
pub fn new(double_escape_action: DoubleEscapeAction) -> Self
Build a fresh state with the configured double-Esc action.
Sourcepub fn set_double_escape_action(&mut self, action: DoubleEscapeAction)
pub fn set_double_escape_action(&mut self, action: DoubleEscapeAction)
Update the configured double-Esc action (e.g. after a settings reload).
Sourcepub fn set_sigint_exit_window(&mut self, window: Duration)
pub fn set_sigint_exit_window(&mut self, window: Duration)
Override the Ctrl+C double-tap window (tests / settings override).
Sourcepub fn set_escape_double_window(&mut self, window: Duration)
pub fn set_escape_double_window(&mut self, window: Duration)
Override the Esc double-tap window (tests / settings override).
Sourcepub fn reset_taps(&mut self)
pub fn reset_taps(&mut self)
Drop both remembered taps (called after focus changes / overlays open).
Sourcepub fn last_sigint(&self) -> Option<Instant>
pub fn last_sigint(&self) -> Option<Instant>
Last Ctrl+C timestamp (for tests).
Sourcepub fn last_escape(&self) -> Option<Instant>
pub fn last_escape(&self) -> Option<Instant>
Last Esc timestamp (for tests).
Trait Implementations§
Source§impl Clone for InputState
impl Clone for InputState
Source§fn clone(&self) -> InputState
fn clone(&self) -> InputState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for InputState
Source§impl Debug for InputState
impl Debug for InputState
Auto Trait Implementations§
impl Freeze for InputState
impl RefUnwindSafe for InputState
impl Send for InputState
impl Sync for InputState
impl Unpin for InputState
impl UnsafeUnpin for InputState
impl UnwindSafe for InputState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.