Struct alacritty::event::Mouse

source ·
pub struct Mouse {
Show 14 fields pub left_button_state: ElementState, pub middle_button_state: ElementState, pub right_button_state: ElementState, pub last_click_timestamp: Instant, pub last_click_button: MouseButton, pub click_state: ClickState, pub accumulated_scroll: AccumulatedScroll, pub cell_side: Side, pub lines_scrolled: f32, pub block_hint_launcher: bool, pub hint_highlight_dirty: bool, pub inside_text_area: bool, pub x: usize, pub y: usize,
}
Expand description

State of the mouse.

Fields§

§left_button_state: ElementState§middle_button_state: ElementState§right_button_state: ElementState§last_click_timestamp: Instant§last_click_button: MouseButton§click_state: ClickState§accumulated_scroll: AccumulatedScroll§cell_side: Side§lines_scrolled: f32§block_hint_launcher: bool§hint_highlight_dirty: bool§inside_text_area: bool§x: usize§y: usize

Implementations§

source§

impl Mouse

source

pub fn point(&self, size: &SizeInfo, display_offset: usize) -> Point

Convert mouse pixel coordinates to viewport point.

If the coordinates are outside of the terminal grid, like positions inside the padding, the coordinates will be clamped to the closest grid coordinates.

Trait Implementations§

source§

impl Debug for Mouse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Mouse

source§

fn default() -> Mouse

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Mouse

§

impl Send for Mouse

§

impl Sync for Mouse

§

impl Unpin for Mouse

§

impl UnwindSafe for Mouse

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.