pub struct MouseEvent {
pub kind: MouseEventKind,
pub position: Pos,
pub pixel_position: Option<PhysicalPos>,
pub modifiers: KeyModifiers,
}Expand description
Mouse input event.
Does not derive Eq/Hash: MouseEventKind does not (its Scroll variant’s f32
fields implement neither).
Fields§
§kind: MouseEventKindThe kind of mouse event.
position: PosCell-grid position of the mouse cursor.
pixel_position: Option<PhysicalPos>Physical pixel position of the mouse cursor, relative to the window’s top-left.
Populated by backends that support sub-cell precision (e.g. the software
renderer). None on character-mode backends such as crossterm.
modifiers: KeyModifiersModifiers held down during the event.
Trait Implementations§
Source§impl Clone for MouseEvent
impl Clone for MouseEvent
Source§fn clone(&self) -> MouseEvent
fn clone(&self) -> MouseEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MouseEvent
Source§impl Debug for MouseEvent
impl Debug for MouseEvent
Source§impl PartialEq for MouseEvent
impl PartialEq for MouseEvent
impl StructuralPartialEq for MouseEvent
Auto Trait Implementations§
impl Freeze for MouseEvent
impl RefUnwindSafe for MouseEvent
impl Send for MouseEvent
impl Sync for MouseEvent
impl Unpin for MouseEvent
impl UnsafeUnpin for MouseEvent
impl UnwindSafe for MouseEvent
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