pub struct InputHandler { /* private fields */ }Expand description
Input handler for processing keyboard and mouse events
Implementations§
Source§impl InputHandler
impl InputHandler
Sourcepub fn handle_key(
&mut self,
key: KeyEvent,
input_text: &str,
_cursor_pos: usize,
is_busy: bool,
has_autocomplete: bool,
) -> Result<InputAction, CliError>
pub fn handle_key( &mut self, key: KeyEvent, input_text: &str, _cursor_pos: usize, is_busy: bool, has_autocomplete: bool, ) -> Result<InputAction, CliError>
Handle a keyboard event and return the action to take
Sourcepub fn handle_mouse(&mut self, mouse: MouseEvent) -> Result<bool, CliError>
pub fn handle_mouse(&mut self, mouse: MouseEvent) -> Result<bool, CliError>
Handle a mouse event
Sourcepub fn tick_cursor_blink(&mut self)
pub fn tick_cursor_blink(&mut self)
Tick cursor blink animation
Sourcepub fn cursor_blink_state(&self) -> bool
pub fn cursor_blink_state(&self) -> bool
Get current cursor blink state
Sourcepub fn reset_esc_time(&mut self)
pub fn reset_esc_time(&mut self)
Reset last ESC time
Sourcepub fn last_esc_time(&self) -> Option<Instant>
pub fn last_esc_time(&self) -> Option<Instant>
Get last ESC time
Sourcepub fn set_last_esc_time(&mut self, time: Instant)
pub fn set_last_esc_time(&mut self, time: Instant)
Set last ESC time
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputHandler
impl RefUnwindSafe for InputHandler
impl Send for InputHandler
impl Sync for InputHandler
impl Unpin for InputHandler
impl UnsafeUnpin for InputHandler
impl UnwindSafe for InputHandler
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
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 more