pub struct MouseState {
pub coords: MousePosition,
pub button_pressed: Vec<bool>,
}
Expand description
A simple structure containing the current mouse coordinates and the
state of each mouse button that we can query. Currently, Windows and
Linux provide nice ways to query five mouse buttons. Since button
numbers are 1-based, button_pressed[0]
is assumed to be false and
have no meaning.
Fields§
§coords: MousePosition
Coordinates in pixel.
State of each mouse button.
Trait Implementations§
Source§impl Clone for MouseState
impl Clone for MouseState
Source§fn clone(&self) -> MouseState
fn clone(&self) -> MouseState
Returns a copy 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§fn default() -> MouseState
fn default() -> MouseState
Returns the “default value” for a type. Read more
Source§impl PartialEq for MouseState
impl PartialEq 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