pub struct KeyBindings {Show 16 fields
pub move_up: Vec<KeyCombo>,
pub move_down: Vec<KeyCombo>,
pub move_left: Vec<KeyCombo>,
pub move_right: Vec<KeyCombo>,
pub move_line_start: Vec<KeyCombo>,
pub move_line_end: Vec<KeyCombo>,
pub delete_char_before: Vec<KeyCombo>,
pub delete_char_at: Vec<KeyCombo>,
pub kill_line: Vec<KeyCombo>,
pub insert_newline: Vec<KeyCombo>,
pub submit: Vec<KeyCombo>,
pub interrupt: Vec<KeyCombo>,
pub quit: Vec<KeyCombo>,
pub force_quit: Vec<KeyCombo>,
pub enter_exit_mode: Vec<KeyCombo>,
pub exit_timeout_secs: u64,
}Expand description
Key binding configuration.
Specifies which key combinations trigger which actions. Multiple key combinations can be assigned to the same action.
The default is bare_minimum() which only provides
basic functionality. Apps should explicitly choose their bindings:
Fields§
§move_up: Vec<KeyCombo>Move cursor up.
move_down: Vec<KeyCombo>Move cursor down.
move_left: Vec<KeyCombo>Move cursor left.
move_right: Vec<KeyCombo>Move cursor right.
move_line_start: Vec<KeyCombo>Move to line start.
move_line_end: Vec<KeyCombo>Move to line end.
delete_char_before: Vec<KeyCombo>Delete char before cursor.
delete_char_at: Vec<KeyCombo>Delete char at cursor.
kill_line: Vec<KeyCombo>Kill to end of line.
insert_newline: Vec<KeyCombo>Insert newline in multi-line input.
submit: Vec<KeyCombo>Submit message.
interrupt: Vec<KeyCombo>Interrupt current request.
quit: Vec<KeyCombo>Quit immediately (only when input empty and no modal is blocking).
force_quit: Vec<KeyCombo>Force quit (works even in modals).
enter_exit_mode: Vec<KeyCombo>Enter exit confirmation mode (requires pressing twice to exit).
exit_timeout_secs: u64Timeout in seconds for exit confirmation mode.
Implementations§
Source§impl KeyBindings
impl KeyBindings
Sourcepub fn bare_minimum() -> Self
pub fn bare_minimum() -> Self
Bare minimum bindings - only Esc to quit.
This is the default when no bindings are specified.
Apps should explicitly choose their bindings (e.g., emacs() or minimal()).
Only provides:
- Esc to quit (when input is empty)
- Ctrl+Q force quit (always works)
- Enter to submit
- Backspace/Delete for basic editing
- Arrow keys for navigation
Trait Implementations§
Source§impl Clone for KeyBindings
impl Clone for KeyBindings
Source§fn clone(&self) -> KeyBindings
fn clone(&self) -> KeyBindings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KeyBindings
impl Debug for KeyBindings
Auto Trait Implementations§
impl Freeze for KeyBindings
impl RefUnwindSafe for KeyBindings
impl Send for KeyBindings
impl Sync for KeyBindings
impl Unpin for KeyBindings
impl UnwindSafe for KeyBindings
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
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>
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>
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