pub enum InputEvent {
KeyPress {
code: KeyCode,
mods: Modifiers,
},
MouseDown {
col: u16,
row: u16,
button: MouseButton,
mods: Modifiers,
},
MouseUp {
col: u16,
row: u16,
button: MouseButton,
},
MouseMoved {
col: u16,
row: u16,
},
Wheel {
col: u16,
row: u16,
delta: WheelDelta,
},
}Expand description
Platform-neutral input vocabulary. Crossterm’s Event::{Key,Mouse,Resize,…}
and ratzilla’s KeyEvent/MouseEvent/WheelEvent both narrow into this
— anything we don’t need (focus, paste, resize) is dropped at the adapter.
Variants§
KeyPress
A key was pressed. code is the resolved key (with shifted symbols
already mapped to their character form, e.g. Shift+1 → !).
MouseDown
A mouse button went down at terminal cell (col, row).
MouseUp
A mouse button was released. Used to end drag tracking in the tree
modal; click effects fire on MouseDown, not on MouseUp.
MouseMoved
The mouse moved over (col, row) — used for hover highlighting.
Drag events normalize to this too; the router doesn’t care which.
Wheel
Scroll wheel scrolled. (col, row) is the cursor cell at the time
of the wheel tick — used to gate zoom to the play-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 moreAuto 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> 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