pub trait MouseSystem {
fn is_supported(&self) -> bool;
fn down_signal(&self) -> &Signal1<MouseEvent>;
fn move_signal(&self) -> &Signal1<MouseEvent>;
fn up_signal(&self) -> &Signal1<MouseEvent>;
fn scroll_signal(&self) -> &Signal1<f32>;
fn x(&self) -> f32;
fn y(&self) -> f32;
fn cursor(&self) -> MouseCursor;
fn is_down(&self, button: MouseButton) -> bool;
}
Expand description
Functions related to the environment’s mouse.
Required Methods
fn is_supported(&self) -> bool
fn is_supported(&self) -> bool
True if the environment has a mouse.
fn down_signal(&self) -> &Signal1<MouseEvent>
fn down_signal(&self) -> &Signal1<MouseEvent>
Emitted when a mouse button is pressed down.
fn move_signal(&self) -> &Signal1<MouseEvent>
fn move_signal(&self) -> &Signal1<MouseEvent>
Emitted when the mouse cursor is moved while over the stage.
fn up_signal(&self) -> &Signal1<MouseEvent>
fn up_signal(&self) -> &Signal1<MouseEvent>
Emitted when a mouse button is released.
fn scroll_signal(&self) -> &Signal1<f32>
fn scroll_signal(&self) -> &Signal1<f32>
A velocity emitted when the mouse wheel or trackpad is scrolled. A positive value is an upward scroll, negative is a downward scroll. Typically, each scroll wheel “click” equates to 1 velocity.
fn cursor(&self) -> MouseCursor
fn cursor(&self) -> MouseCursor
The style of the mouse cursor.
fn is_down(&self, button: MouseButton) -> bool
fn is_down(&self, button: MouseButton) -> bool
@returns True if the given button is currently being held down.