[−][src]Struct winput::Mouse
A zero-sized structure that wraps functions related to the mouse.
Implementations
impl Mouse
[src]
pub fn position() -> Result<(i32, i32), WindowsError>
[src]
Retrieve the current position of the mouse, in screen coordinates.
Example
ⓘ
use winput::Mouse; println!("The mouse is at {:?}", Mouse::position());
pub fn set_position(x: i32, y: i32) -> Result<(), WindowsError>
[src]
Sets the position of the mouse, in screen coordinates.
Example
ⓘ
use winput::{Vk, Mouse}; Mouse::set_position(50, 50).unwrap();
pub fn scroll(amount: f32) -> Result<(), WindowsError>
[src]
pub fn scrollh(amount: f32) -> Result<(), WindowsError>
[src]
pub fn move_relative(dx: i32, dy: i32) -> Result<(), WindowsError>
[src]
Moves the mouse relatively to its current position, in screen coordinates.
Example
ⓘ
use winput::Mouse; Mouse::move_relative(100, 50).unwrap();
pub fn move_absolute(x: f32, y: f32) -> Result<(), WindowsError>
[src]
Moves the mouse using absolute normalized coordinates.
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
[src]
impl Send for Mouse
[src]
impl Sync for Mouse
[src]
impl Unpin for Mouse
[src]
impl UnwindSafe for Mouse
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,