pub struct DefaultKeyHandler { /* private fields */ }Expand description
Default key handler with configurable bindings.
This implementation uses KeyBindings to determine what actions
to take for each key press. It handles the standard key processing
flow while allowing customization of all bindings.
The handler manages exit confirmation state internally, so agents get the two-key exit flow (e.g., press Ctrl+D twice) without needing to track any state in the App.
Implementations§
Source§impl DefaultKeyHandler
impl DefaultKeyHandler
Sourcepub fn new(bindings: KeyBindings) -> Self
pub fn new(bindings: KeyBindings) -> Self
Create a new handler with the given bindings.
Trait Implementations§
Source§impl Default for DefaultKeyHandler
impl Default for DefaultKeyHandler
Source§impl KeyHandler for DefaultKeyHandler
impl KeyHandler for DefaultKeyHandler
Source§fn handle_key(&mut self, key: KeyEvent, context: &KeyContext) -> AppKeyResult
fn handle_key(&mut self, key: KeyEvent, context: &KeyContext) -> AppKeyResult
Handle a key event. Read more
Auto Trait Implementations§
impl Freeze for DefaultKeyHandler
impl RefUnwindSafe for DefaultKeyHandler
impl Send for DefaultKeyHandler
impl Sync for DefaultKeyHandler
impl Unpin for DefaultKeyHandler
impl UnwindSafe for DefaultKeyHandler
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