#[non_exhaustive]pub enum InputEvent {
Show 21 variants
Exit,
UpdateTermArea(usize, usize),
UpdateUpperMark(usize),
UpdateLineNumber(LineNumbers),
Number(char),
RestorePrompt,
HorizontalScroll(bool),
UpdateLeftMark(usize),
StartSelection {
x: u16,
y: u16,
},
UpdateSelection {
x: u16,
y: u16,
},
ClearSelection,
CopySelection,
Ignore,
Search(SearchMode),
NextMatch,
PrevMatch,
MoveToNextMatch(usize),
MoveToPrevMatch(usize),
FollowOutput(bool),
ToggleSmartCase,
ShowHelp,
}Expand description
Events handled by the minus pager.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Exit
Ctrl+C or Q, exits the application.
UpdateTermArea(usize, usize)
The terminal was resized. Contains the new number of rows.
UpdateUpperMark(usize)
Sent by movement keys like Up Down, PageUp, PageDown, ‘g’, G etc.
Contains the new value for the upper mark.
UpdateLineNumber(LineNumbers)
Ctrl+L, inverts the line number display. Contains the new value.
Number(char)
A number key has been pressed. This inner value is stored as a char.
The input loop will append this number to its count string variable
RestorePrompt
Restore the original prompt
HorizontalScroll(bool)
Whether to allow Horizontal scrolling
UpdateLeftMark(usize)
Sets the left mark of Horizontal scrolling
Sent by keys like l, h, right, left etc.
StartSelection
Start a mouse selection at the given screen coordinates.
UpdateSelection
Update the current mouse selection to the given screen coordinates.
ClearSelection
Clear the current mouse selection.
CopySelection
clipboard only.Copy the current selection.
Ignore
Tells the event hadler to not do anything for this event
This is extremely useful when you want to execute arbitrary code on events without necessarily asking the event handler to do anything special for this event. See Custom Actions on User Events.
Search(SearchMode)
search only./, Searching for certain pattern of text
NextMatch
Use InputEvent::MoveToNextMatch(1) for the same effect.
search only.Get to the next match in forward mode
WARNING: This has been deprecated in favour of MoveToNextMatch. This will likely be
removed in the next major release.
PrevMatch
Use InputEvent::MoveToPrevMatch(1) for the same effect.
search only.Get to the previous match in forward mode
WARNING: This has been deprecated in favour of MoveToPrevMatch. This will likely be
removed in the next major release.
MoveToNextMatch(usize)
search only.Move to the next nth match in the given direction
MoveToPrevMatch(usize)
search only.Move to the previous nth match in the given direction
FollowOutput(bool)
Control follow mode.
When set to true, minus ensures that the user’s screen always follows the end part of the output. By default it is turned off.
This is similar to Pager::follow_output except that
this is used to control it from the user’s side.
ToggleSmartCase
search only.Toggle smart case searching mode.
ShowHelp
Show help message in the prompt area.
Trait Implementations§
Source§impl Clone for InputEvent
impl Clone for InputEvent
Source§fn clone(&self) -> InputEvent
fn clone(&self) -> InputEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InputEvent
Source§impl Debug for InputEvent
impl Debug for InputEvent
impl Eq for InputEvent
Source§impl PartialEq for InputEvent
impl PartialEq for InputEvent
impl StructuralPartialEq for InputEvent
Auto Trait Implementations§
impl Freeze for InputEvent
impl RefUnwindSafe for InputEvent
impl Send for InputEvent
impl Sync for InputEvent
impl Unpin for InputEvent
impl UnsafeUnpin for InputEvent
impl UnwindSafe for InputEvent
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.