pub struct Mouse;Expand description
A zero-sized structure that wraps functions related to the mouse.
Implementations§
Source§impl Mouse
impl Mouse
Sourcepub fn set_position(x: i32, y: i32) -> Result<(), WindowsError>
pub fn set_position(x: i32, y: i32) -> Result<(), WindowsError>
Sourcepub fn move_relative(dx: i32, dy: i32)
pub fn move_relative(dx: i32, dy: i32)
Moves the mouse relatively to its current position, in screen coordinates.
If the function fails to synthesize the input, no error is emited and the
function fails silently. If you wish to retreive an eventual error, use
send_inputs instead.
§Example
ⓘ
use winput::Mouse;
Mouse::move_relative(100, 50).unwrap();Sourcepub fn move_absolute(x: f32, y: f32)
pub fn move_absolute(x: f32, y: f32)
Moves the mouse using absolute normalized coordinates.
If the function fails to synthesize the input, no error is emited and the
function fails silently. If you wish to retreive an eventual error, use
send_inputs instead.
§Example
ⓘ
use winput::Mouse;
// Move the mouse in the center of the main monitor.
Mouse::move_absolute(0.5, 0.5).unwrap();Auto Trait Implementations§
impl Freeze for Mouse
impl RefUnwindSafe for Mouse
impl Send for Mouse
impl Sync for Mouse
impl Unpin for Mouse
impl UnwindSafe for Mouse
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