pub enum InputEvent {
Key {
code: KeyCode,
modifiers: KeyModifiers,
},
MouseDown(MouseEvent),
MouseUp(MouseEvent),
MouseMove(MouseEvent),
MouseScroll {
x: u16,
y: u16,
delta: i16,
},
Resize {
width: u16,
height: u16,
},
FocusGained,
FocusLost,
Paste(String),
Error(String),
Shutdown,
}Expand description
Events from the input thread.
These are sent from the input actor to the main loop.
Variants§
Key
A key was pressed.
MouseDown(MouseEvent)
Mouse button pressed.
MouseUp(MouseEvent)
Mouse button released.
MouseMove(MouseEvent)
Mouse moved (only if tracking enabled).
MouseScroll
Mouse scroll.
Fields
Resize
Terminal was resized.
FocusGained
Focus gained.
FocusLost
Focus lost.
Paste(String)
Paste event (bracketed paste).
Error(String)
Input thread encountered an error.
Shutdown
Input thread is shutting down.
Trait Implementations§
Source§impl Clone for InputEvent
impl Clone for InputEvent
Source§fn clone(&self) -> InputEvent
fn clone(&self) -> InputEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InputEvent
impl RefUnwindSafe for InputEvent
impl Send for InputEvent
impl Sync for InputEvent
impl Unpin 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
Mutably borrows from an owned value. Read more