[][src]Struct winput::Mouse

pub struct 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]

Synthesizes a vertical scroll event.

Example

use winput::Mouse;

Mouse::scroll(1.0).unwrap();

pub fn scrollh(amount: f32) -> Result<(), WindowsError>[src]

Synthesizes a horizontal scroll event.

Example

use winput::Mouse;

Mouse::scrollh(1.0).unwrap();

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.