pub enum MouseEvent {
Down(MouseButton, u16, u16, KeyModifiers),
Up(MouseButton, u16, u16, KeyModifiers),
Drag(MouseButton, u16, u16, KeyModifiers),
ScrollDown(u16, u16, KeyModifiers),
ScrollUp(u16, u16, KeyModifiers),
}Expand description
Represents a mouse event.
§Platform-specific Notes
§Mouse Buttons
Some platforms/terminals do not report mouse button for the
MouseEvent::Up and MouseEvent::Drag events. MouseButton::Left
is returned if we don’t know which button was used.
§Key Modifiers
Some platforms/terminals does not report all key modifiers
combinations for all mouse event types. For example - macOS reports
Ctrl + left mouse button click as a right mouse button click.
Variants§
Down(MouseButton, u16, u16, KeyModifiers)
Pressed mouse button.
Contains mouse button, pressed pointer location (column, row), and additional key modifiers.
Up(MouseButton, u16, u16, KeyModifiers)
Released mouse button.
Contains mouse button, released pointer location (column, row), and additional key modifiers.
Drag(MouseButton, u16, u16, KeyModifiers)
Moved mouse pointer while pressing a mouse button.
Contains the pressed mouse button, released pointer location (column, row), and additional key modifiers.
ScrollDown(u16, u16, KeyModifiers)
Scrolled mouse wheel downwards (towards the user).
Contains the scroll location (column, row), and additional key modifiers.
ScrollUp(u16, u16, KeyModifiers)
Scrolled mouse wheel upwards (away from the user).
Contains the scroll location (column, row), and additional key modifiers.
Trait Implementations§
Source§impl Clone for MouseEvent
impl Clone for MouseEvent
Source§fn clone(&self) -> MouseEvent
fn clone(&self) -> MouseEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more