Struct nannou::state::mouse::ButtonMap [−][src]
pub struct ButtonMap<S = DefaultScalar> { /* fields omitted */ }
Stores the state of all mouse buttons.
If the mouse button is down, it stores the position of the mouse when the button was pressed
Methods
impl<S> ButtonMap<S> where
S: BaseFloat,
[src]
impl<S> ButtonMap<S> where
S: BaseFloat,
pub fn new() -> Self
[src]
pub fn new() -> Self
Returns a new button map with all states set to None
pub fn relative_to(self, xy: Point2<S>) -> Self
[src]
pub fn relative_to(self, xy: Point2<S>) -> Self
Returns a copy of the ButtonMap relative to the given Point
pub fn left(&self) -> &ButtonPosition<S>
[src]
pub fn left(&self) -> &ButtonPosition<S>
The state of the left mouse button.
pub fn middle(&self) -> &ButtonPosition<S>
[src]
pub fn middle(&self) -> &ButtonPosition<S>
The state of the middle mouse button.
pub fn right(&self) -> &ButtonPosition<S>
[src]
pub fn right(&self) -> &ButtonPosition<S>
The state of the right mouse button.
pub fn press(&mut self, button: Button, xy: Point2<S>)
[src]
pub fn press(&mut self, button: Button, xy: Point2<S>)
Sets the Button
in the Down
position.
pub fn release(&mut self, button: Button)
[src]
pub fn release(&mut self, button: Button)
Set's the Button
in the Up
position.
ⓘImportant traits for PressedButtons<'a, S>pub fn pressed(&self) -> PressedButtons<S>
[src]
pub fn pressed(&self) -> PressedButtons<S>
An iterator yielding all pressed mouse buttons along with the location at which they were originally pressed.
Trait Implementations
impl<S: Copy> Copy for ButtonMap<S>
[src]
impl<S: Copy> Copy for ButtonMap<S>
impl<S: Clone> Clone for ButtonMap<S>
[src]
impl<S: Clone> Clone for ButtonMap<S>
fn clone(&self) -> ButtonMap<S>
[src]
fn clone(&self) -> ButtonMap<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for ButtonMap<S>
[src]
impl<S: Debug> Debug for ButtonMap<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: PartialEq> PartialEq for ButtonMap<S>
[src]
impl<S: PartialEq> PartialEq for ButtonMap<S>
fn eq(&self, other: &ButtonMap<S>) -> bool
[src]
fn eq(&self, other: &ButtonMap<S>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ButtonMap<S>) -> bool
[src]
fn ne(&self, other: &ButtonMap<S>) -> bool
This method tests for !=
.
impl<S> Index<Button> for ButtonMap<S>
[src]
impl<S> Index<Button> for ButtonMap<S>