[−][src]Struct buttons::Mouse
A structure representing the current state of a mouse.
Methods
impl<Button, Coord> Mouse<Button, Coord> where
Button: Copy + PartialEq,
Coord: Copy + Default + Add<Output = Coord>,
[src]
Button: Copy + PartialEq,
Coord: Copy + Default + Add<Output = Coord>,
pub fn new() -> Self
[src]
pub fn at_position(position: [Coord; 2]) -> Self
[src]
Create the Mouse at a specific pointer position.
pub fn begin_frame_input(&mut self) -> MouseInput<Button, Coord>
[src]
Returns a MouseInput
structure that can be used to
register changes to the button and pointer state of the
mouse.
pub fn position(&self) -> [Coord; 2]
[src]
Returns the position of the mouse pointer.
pub fn down(&self, button: Button) -> bool
[src]
Returns true
if the given button is currently held down.
pub fn pressed(&self, button: Button) -> bool
[src]
Returns true
if the given button was pressed this frame.
pub fn released(&self, button: Button) -> bool
[src]
Returns true
if the given button was released this frame.
Trait Implementations
impl<Button: Clone, Coord: Clone> Clone for Mouse<Button, Coord> where
Button: Copy + PartialEq,
Coord: Copy + Default + Add<Output = Coord>,
[src]
Button: Copy + PartialEq,
Coord: Copy + Default + Add<Output = Coord>,
impl<Button: Debug, Coord: Debug> Debug for Mouse<Button, Coord> where
Button: Copy + PartialEq,
Coord: Copy + Default + Add<Output = Coord>,
[src]
Button: Copy + PartialEq,
Coord: Copy + Default + Add<Output = Coord>,
impl<Button, Coord> Default for Mouse<Button, Coord> where
Button: Copy + PartialEq,
Coord: Copy + Default + Add<Output = Coord>,
[src]
Button: Copy + PartialEq,
Coord: Copy + Default + Add<Output = Coord>,
Auto Trait Implementations
impl<Button, Coord> RefUnwindSafe for Mouse<Button, Coord> where
Button: RefUnwindSafe,
Coord: RefUnwindSafe,
Button: RefUnwindSafe,
Coord: RefUnwindSafe,
impl<Button, Coord> Send for Mouse<Button, Coord> where
Button: Send,
Coord: Send,
Button: Send,
Coord: Send,
impl<Button, Coord> Sync for Mouse<Button, Coord> where
Button: Sync,
Coord: Sync,
Button: Sync,
Coord: Sync,
impl<Button, Coord> Unpin for Mouse<Button, Coord> where
Button: Unpin,
Coord: Unpin,
Button: Unpin,
Coord: Unpin,
impl<Button, Coord> UnwindSafe for Mouse<Button, Coord> where
Button: UnwindSafe,
Coord: UnwindSafe,
Button: UnwindSafe,
Coord: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,