pub enum Event {
Cancel {
selected: Option<usize>,
},
Ok {
alt: bool,
selected: usize,
},
CustomInput {
alt: bool,
selected: Option<usize>,
},
Complete {
selected: Option<usize>,
},
DeleteEntry {
selected: usize,
},
CustomCommand {
number: u8,
selected: Option<usize>,
},
}Expand description
An event triggered by the user.
Variants§
Cancel
The user cancelled the operation, for example by pressing escape.
Fields
selected: Option<usize>The index of the line that was selected at the time of cancellation, if one was selected.
If present, this will be < Mode::entries.
Ok
The user accepted an option from the list (ctrl+j, ctrl+m or enter by default).
Fields
CustomInput
The user entered an input not on the list (ctrl+return by default).
Fields
selected: Option<usize>The index of the line that was selected at the time of the event, if one was selected.
If present, this will be < Mode::entries.
Complete
The user used the kb-mode-complete binding (control+l by default).
If this happens,
you should set the input value
to the currently selected entry
if there is one.
Fields
selected: Option<usize>The index of the line that was selected at the time of the event, if one was selected.
If present, this will be < Mode::entries.
DeleteEntry
The user used the kb-delete-entry binding (shift+delete by default).
Fields
selected: usizeThe index of the entry that was selected to be deleted.
If present, this will be < Mode::entries.
CustomCommand
The user ran a custom command.