Enum winput::message_loop::Event[][src]

pub enum Event {
    Keyboard {
        vk: Vk,
        scan_code: u32,
        action: Action,
    },
    MouseMoveRelative {
        x: i32,
        y: i32,
    },
    MouseMoveAbsolute {
        x: f32,
        y: f32,
        virtual_desk: bool,
    },
    MouseButton {
        action: Action,
        button: Button,
    },
    MouseWheel {
        delta: f32,
        direction: WheelDirection,
    },
}
Expand description

An event of any kind.

Variants

Keyboard
Show fields

Fields of Keyboard

vk: Vk

The virtual keycode of the key that was pressed.

scan_code: u32

The scan code of that key.

action: Action

The action that was taken on the key.

MouseMoveRelative
Show fields

Fields of MouseMoveRelative

x: i32

The x coordinate of the mouse, in per-monitor-aware screen coordinates.

y: i32

The y coordinate of the mouse, in per-monitor-aware screen coordinates.

MouseMoveAbsolute
Show fields

Fields of MouseMoveAbsolute

x: f32

The x coordinate of the mouse in screen coordinates.

y: f32

The y coordinate of the mouse in screen coordinates.

virtual_desk: bool

If this flag is set to true, the x and y coordinates map to the entier virtual desktop (this is relevent if multiple monitors are used).

MouseButton
Show fields

Fields of MouseButton

action: Action

The action that was taken on the mouse button.

button: Button

The mouse button involved in the event.

MouseWheel
Show fields

Fields of MouseWheel

delta: f32

The amount of rotation of the wheel. Positive values indicate that the wheel was rotated forward, away from the user; a negative value means that the wheel was rotated backward, toward the user.

direction: WheelDirection

The direction of the wheel.

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

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.