pub struct PointerState {
pub pos: Option<(f64, f64)>,
pub button_down: Option<MouseButton>,
pub clicked: Option<MouseButton>,
pub double_clicked: Option<MouseButton>,
pub triple_clicked: Option<MouseButton>,
pub prev_pos: Option<(f64, f64)>,
}Expand description
Mouse/touch pointer state
Fields§
§pos: Option<(f64, f64)>Current pointer position (None if not over canvas)
Which button is currently held down (if any)
clicked: Option<MouseButton>Which button was clicked this frame (single click)
double_clicked: Option<MouseButton>Which button was double-clicked this frame
triple_clicked: Option<MouseButton>Which button was triple-clicked this frame
prev_pos: Option<(f64, f64)>Previous pointer position (for calculating delta)
Implementations§
Source§impl PointerState
impl PointerState
Trait Implementations§
Source§impl Clone for PointerState
impl Clone for PointerState
Source§fn clone(&self) -> PointerState
fn clone(&self) -> PointerState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PointerState
impl Debug for PointerState
Source§impl Default for PointerState
impl Default for PointerState
Source§fn default() -> PointerState
fn default() -> PointerState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PointerState
impl RefUnwindSafe for PointerState
impl Send for PointerState
impl Sync for PointerState
impl Unpin for PointerState
impl UnsafeUnpin for PointerState
impl UnwindSafe for PointerState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more