#[repr(C)]pub struct MouseState {
pub mouse_cursor_type: OptionMouseCursorType,
pub cursor_position: CursorPosition,
pub is_cursor_locked: bool,
pub left_down: bool,
pub right_down: bool,
pub middle_down: bool,
}Expand description
Mouse position, cursor type, user scroll input, etc.
Fields§
§mouse_cursor_type: OptionMouseCursorTypeCurrent mouse cursor type, set to None if the cursor is hidden. (READWRITE)
cursor_position: CursorPositionWhere is the mouse cursor currently? Set to None if the window is not focused.
(READWRITE)
is_cursor_locked: boolIs the mouse cursor locked to the current window (important for applications like games)? (READWRITE)
left_down: boolIs the left mouse button down? (READONLY)
right_down: boolIs the right mouse button down? (READONLY)
middle_down: boolIs the middle mouse button down? (READONLY)
Implementations§
Source§impl MouseState
impl MouseState
pub fn matches(&self, context: &ContextMenuMouseButton) -> bool
Source§impl MouseState
impl MouseState
Sourcepub fn mouse_down(&self) -> bool
pub fn mouse_down(&self) -> bool
Returns whether any mouse button (left, right or center) is currently held down
Trait Implementations§
Source§impl Clone for MouseState
impl Clone for MouseState
Source§fn clone(&self) -> MouseState
fn clone(&self) -> MouseState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MouseState
impl Debug for MouseState
Source§impl Default for MouseState
impl Default for MouseState
Source§impl PartialEq for MouseState
impl PartialEq for MouseState
Source§impl PartialOrd for MouseState
impl PartialOrd for MouseState
impl Copy for MouseState
impl StructuralPartialEq for MouseState
Auto Trait Implementations§
impl Freeze for MouseState
impl RefUnwindSafe for MouseState
impl Send for MouseState
impl Sync for MouseState
impl Unpin for MouseState
impl UnwindSafe for MouseState
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
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>
Converts
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>
Converts
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