Trait piston_window::MouseCursorEvent
pub trait MouseCursorEvent: Sized {
// Required methods
fn from_pos(pos: [f64; 2], old_event: &Self) -> Option<Self>;
fn mouse_cursor<U, F>(&self, f: F) -> Option<U>
where F: FnMut([f64; 2]) -> U;
// Provided method
fn mouse_cursor_args(&self) -> Option<[f64; 2]> { ... }
}
Expand description
The position of the mouse cursor.
Required Methods§
fn from_pos(pos: [f64; 2], old_event: &Self) -> Option<Self>
fn from_pos(pos: [f64; 2], old_event: &Self) -> Option<Self>
Creates a mouse cursor event.
Preserves time stamp from original input event, if any.
fn mouse_cursor<U, F>(&self, f: F) -> Option<U>where
F: FnMut([f64; 2]) -> U,
fn mouse_cursor<U, F>(&self, f: F) -> Option<U>where F: FnMut([f64; 2]) -> U,
Calls closure if this is a mouse cursor event.
Provided Methods§
fn mouse_cursor_args(&self) -> Option<[f64; 2]>
fn mouse_cursor_args(&self) -> Option<[f64; 2]>
Returns mouse cursor arguments.