logo
#[repr(C)]
pub enum MouseEvent {
    MousePressed {
        pos: Point,
        button: PointerEventButton,
    },
    MouseReleased {
        pos: Point,
        button: PointerEventButton,
    },
    MouseMoved {
        pos: Point,
    },
    MouseWheel {
        pos: Point,
        delta: Point,
    },
    MouseExit,
}
Expand description

A Mouse event

Variants

MousePressed

Fields

pos: Point

The mouse was pressed

MouseReleased

Fields

pos: Point

The mouse was released

MouseMoved

Fields

pos: Point

The mouse position has changed

MouseWheel

Fields

pos: Point
delta: Point

Wheel was operated. pos is the position of the mouse when the event happens. delta is the amount of pixel to scroll.

MouseExit

The mouse exited the item or component

Implementations

The position of the cursor

Translate the position by the given value

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)

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.