Struct winput::Mouse [−][src]
pub struct Mouse;
Expand description
A zero-sized structure that wraps functions related to the mouse.
Implementations
Retrieve the current position of the mouse, in screen coordinates.
Example
use winput::Mouse; println!("The mouse is at {:?}", Mouse::position());
Sets the position of the mouse, in screen coordinates.
Example
use winput::{Vk, Mouse}; Mouse::set_position(50, 50).unwrap();
Synthesizes a vertical scroll event.
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::scroll(1.0).unwrap();
Synthesizes a horizontal scroll event.
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::scrollh(1.0).unwrap();
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();
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 RefUnwindSafe for Mouse
impl UnwindSafe for Mouse