[][src]Struct buttons::Mouse

pub struct Mouse<Button, Coord> where
    Button: Copy + PartialEq,
    Coord: Copy + Default + Add<Output = Coord>, 
{ /* fields omitted */ }

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]

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]

impl<Button: Debug, Coord: Debug> Debug for Mouse<Button, Coord> where
    Button: Copy + PartialEq,
    Coord: Copy + Default + Add<Output = Coord>, 
[src]

impl<Button, Coord> Default for Mouse<Button, Coord> where
    Button: Copy + PartialEq,
    Coord: Copy + Default + Add<Output = Coord>, 
[src]

Auto Trait Implementations

impl<Button, Coord> RefUnwindSafe for Mouse<Button, Coord> where
    Button: RefUnwindSafe,
    Coord: RefUnwindSafe

impl<Button, Coord> Send for Mouse<Button, Coord> where
    Button: Send,
    Coord: Send

impl<Button, Coord> Sync for Mouse<Button, Coord> where
    Button: Sync,
    Coord: Sync

impl<Button, Coord> Unpin for Mouse<Button, Coord> where
    Button: Unpin,
    Coord: Unpin

impl<Button, Coord> UnwindSafe for Mouse<Button, Coord> where
    Button: UnwindSafe,
    Coord: UnwindSafe

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.