[−][src]Struct buttons::MouseInput
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]
Button: Copy + PartialEq,
Coord: Copy + Default + Add<Output = Coord>,
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]
fn handle(&self, mouse: &mut MouseInput<MouseButton, f64>)
[src]
impl<'a> Event<MouseInput<'a, MouseButton, f64>> for WindowEvent
[src]
fn handle(&self, mouse: &mut MouseInput<MouseButton, f64>)
[src]
Auto Trait Implementations
impl<'a, Button, Coord> RefUnwindSafe for MouseInput<'a, Button, Coord> where
Button: RefUnwindSafe,
Coord: RefUnwindSafe,
Button: RefUnwindSafe,
Coord: RefUnwindSafe,
impl<'a, Button, Coord> Send for MouseInput<'a, Button, Coord> where
Button: Send,
Coord: Send,
Button: Send,
Coord: Send,
impl<'a, Button, Coord> Sync for MouseInput<'a, Button, Coord> where
Button: Sync,
Coord: Sync,
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]
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, 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>,