[][src]Struct buttons::MouseInput

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

An object that has methods for registering mouse inputs this frame. It must be dropped before the underlying Mouse can be queried.

Methods

impl<'a, Button, Coord> MouseInput<'a, Button, Coord> where
    Button: Copy + PartialEq,
    Coord: Copy + Default + Add<Output = Coord>, 
[src]

pub fn move_to(&mut self, position: [Coord; 2]) -> &mut Self[src]

Set the position of the mouse to the given value.

pub fn move_by(&mut self, [x, y]: [Coord; 2]) -> &mut Self[src]

Modify the position of the mouse by the given offset.

pub fn press(&mut self, button: Button) -> &mut Self[src]

Register that a button was pressed down.

pub fn release(&mut self, button: Button) -> &mut Self[src]

Register that a button was released.

pub fn handle_event<E: Event<Self>>(&mut self, event: &E) -> &mut Self[src]

Convenience method for handling events. The type of event, E, will vary depending on the windowing library being used.

Trait Implementations

impl<'a> Event<MouseInput<'a, MouseButton, f64>> for WinitEvent[src]

impl<'a> Event<MouseInput<'a, MouseButton, f64>> for WindowEvent[src]

Auto Trait Implementations

impl<'a, Button, Coord> RefUnwindSafe for MouseInput<'a, Button, Coord> where
    Button: RefUnwindSafe,
    Coord: RefUnwindSafe

impl<'a, Button, Coord> Send for MouseInput<'a, Button, Coord> where
    Button: Send,
    Coord: Send

impl<'a, Button, Coord> Sync for MouseInput<'a, Button, Coord> where
    Button: Sync,
    Coord: Sync

impl<'a, Button, Coord> Unpin for MouseInput<'a, Button, Coord>

impl<'a, Button, Coord> !UnwindSafe for MouseInput<'a, Button, Coord>

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, 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.