[][src]Struct azul_core::window::MouseState

pub struct MouseState {
    pub mouse_cursor_type: Option<MouseCursorType>,
    pub cursor_position: CursorPosition,
    pub is_cursor_locked: bool,
    pub left_down: bool,
    pub right_down: bool,
    pub middle_down: bool,
    pub scroll_x: Option<f32>,
    pub scroll_y: Option<f32>,
}

Mouse position, cursor type, user scroll input, etc.

Fields

mouse_cursor_type: Option<MouseCursorType>

Current mouse cursor type, set to None if the cursor is hidden. (READWRITE)

cursor_position: CursorPosition

Where is the mouse cursor currently? Set to None if the window is not focused. (READWRITE)

is_cursor_locked: bool

Is the mouse cursor locked to the current window (important for applications like games)? (READWRITE)

left_down: bool

Is the left mouse button down? (READONLY)

right_down: bool

Is the right mouse button down? (READONLY)

middle_down: bool

Is the middle mouse button down? (READONLY)

scroll_x: Option<f32>

Scroll amount in pixels in the horizontal direction. Gets reset to 0 after every frame (READONLY)

scroll_y: Option<f32>

Scroll amount in pixels in the vertical direction. Gets reset to 0 after every frame (READONLY)

Implementations

impl MouseState[src]

pub fn mouse_down(&self) -> bool[src]

Returns whether any mouse button (left, right or center) is currently held down

pub fn get_scroll_x(&self) -> f32[src]

pub fn get_scroll_y(&self) -> f32[src]

pub fn get_scroll(&self) -> (f32, f32)[src]

Trait Implementations

impl Clone for MouseState[src]

impl Copy for MouseState[src]

impl Debug for MouseState[src]

impl Default for MouseState[src]

impl PartialEq<MouseState> for MouseState[src]

impl PartialOrd<MouseState> for MouseState[src]

impl StructuralPartialEq for MouseState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.