pub enum Event {
KeyPress(Key),
Mouse(Mouse),
Status(Status),
Focus,
FocusLost,
StateChange(StateChange),
}Available on crate features
events and raw only.Expand description
Known terminal event.
Variants§
KeyPress(Key)
Key was pressed.
Mouse(Mouse)
Mouse event.
Mouse events are sent only if enabled with one of:
codes::ENABLE_MOUSE_XY_PR_TRACKING: enables events only on mouse press, release and scroll.codes::ENABLE_MOUSE_XY_DRAG_TRACKING: also enables drag events.codes::ENABLE_MOUSE_XY_ALL_TRACKING: also enables move events.
It is recommended to use an extension for better encoding of the
events. The recommended extension is codes::ENABLE_MOUSE_XY_EXT.
Status(Status)
Received terminal attributes.
Usually received after request.
Focus
The terminal has gained focus.
The event may be received only if enabled with
codes::ENABLE_FOCUS_EVENT.
FocusLost
The terminal has lost focus.
The event may be received only if enabled with
codes::ENABLE_FOCUS_EVENT.
StateChange(StateChange)
The input state has changed.
Usually requires to be enabled with feature.
Trait Implementations§
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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