pub enum BEvent {
Show 13 variants Resized { new_size: Point, dpi_scale_factor: f32, }, Moved { new_position: Point, }, CloseRequested, Character { c: char, }, Focused { focused: bool, }, CursorEntered, CursorLeft, CursorMoved { position: Point, }, MouseClick { button: usize, pressed: bool, }, MouseButtonDown { button: usize, }, MouseButtonUp { button: usize, }, KeyboardInput { key: VirtualKeyCode, scan_code: u32, pressed: bool, }, ScaleFactorChanged { new_size: Point, dpi_scale_factor: f32, },
}
Expand description

Available device events

Variants

Resized

Fields

new_size: Point
dpi_scale_factor: f32

The window was resized

Moved

Fields

new_position: Point

The window was moved

CloseRequested

The window has requested that it be closed

Character

Fields

c: char

A character was input

Focused

Fields

focused: bool

The window gained or lost focus

CursorEntered

The mouse cursor entered the window

CursorLeft

The mouse cursor left the window

CursorMoved

Fields

position: Point

The mouse cursor moved

MouseClick

Fields

button: usize
pressed: bool

A mouse button was pressed or released

MouseButtonDown

Fields

button: usize

Mouse button is down

MouseButtonUp

Fields

button: usize

Mouse button is up

KeyboardInput

Fields

scan_code: u32
pressed: bool

A key on the keyboard was pressed or released.

ScaleFactorChanged

Fields

new_size: Point
dpi_scale_factor: f32

The window’s scale factor was changed. You generally don’t need to do anything for this, unless you are working with pixel coordinates.

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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.