#[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
Snapshot the button-down flags as a MouseButtonState for drag tracking.
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 (const: unstable) · 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 From<&MouseState> for MouseButtonState
impl From<&MouseState> for MouseButtonState
Source§fn from(s: &MouseState) -> Self
fn from(s: &MouseState) -> Self
Converts to this type from the input type.
Source§impl PartialEq for MouseState
impl PartialEq for MouseState
Source§fn eq(&self, other: &MouseState) -> bool
fn eq(&self, other: &MouseState) -> bool
Tests for
self and other values to be equal, and is used by ==.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 UnsafeUnpin 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