pub struct MouseBuf {
pub delta: (f32, f32),
pub wheel: (f32, f32),
pub x: f32,
pub y: f32,
/* private fields */
}Expand description
A container for Window-based mouse, tablet and touch input events.
Fields§
§delta: (f32, f32)Amount of mouse movement detected since the last update.
wheel: (f32, f32)Amount of wheel scroll detected since the last update.
x: f32The x-axis mouse position in pixels.
y: f32The y-axis mouse position in pixels.
Implementations§
source§impl MouseBuf
impl MouseBuf
sourcepub fn any_held(&self) -> bool
pub fn any_held(&self) -> bool
Returns true if any buttons have been pressed for multiple frames.
sourcepub fn any_pressed(&self) -> bool
pub fn any_pressed(&self) -> bool
Returns true if any buttons have been pressed since the last frame.
sourcepub fn any_released(&self) -> bool
pub fn any_released(&self) -> bool
Returns true if any buttons have been released since the last frame.
sourcepub fn handle_event(&mut self, event: &Event<'_, ()>) -> bool
pub fn handle_event(&mut self, event: &Event<'_, ()>) -> bool
Handles a single event.
sourcepub fn is_held(&self, button: MouseButton) -> bool
pub fn is_held(&self, button: MouseButton) -> bool
Returns true if the given button has been pressed for multiple frames.
sourcepub fn is_pressed(&self, button: MouseButton) -> bool
pub fn is_pressed(&self, button: MouseButton) -> bool
Returns true if the given button has been pressed since the last frame.
sourcepub fn is_released(&self, button: MouseButton) -> bool
pub fn is_released(&self, button: MouseButton) -> bool
Returns true if the given button has been released since the last frame.