Enum winput::MouseMotion[][src]

pub enum MouseMotion {
    Relative {
        dx: i32,
        dy: i32,
    },
    Absolute {
        x: f32,
        y: f32,
        virtual_desk: bool,
    },
}
Expand description

Describes a mouse motion.

Variants

Relative

Describes a relative mouse motion, in pixels.

Relative mouse motion is subject to the effects of the mouse speed and the two-mouse threshold values. A user sets these three values with the Pointer Speed slider of the Control Panel’s Mouse Properties sheet.

Show fields

Fields of Relative

dx: i32

The number of pixels the mouse should move, on the horizontal axis.

dy: i32

The number of pixels the mouse should move, on the vertical axis. A positive value makes the mouse go down.

Absolute

Describes an absolute mouse motion, in normalized coordinates.

Show fields

Fields of Absolute

x: f32

The normalized position of the mouse on the horizontal axis. A value of 0.0 maps to the left of the screen and a value of 1.0 maps to the right of the screen.

y: f32

The normalized position of the mouse on the vertical axis. A value of 0.0 maps to the top of the screen and a value of 1.0 maps to the bottom on the screen.

virtual_desk: bool

Whether the given normalized coordinates should map to the entier virtual desktop (if multiple monitors are used, for example).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.