pub enum WindowEvent {
Show 24 variants RedrawRequested(WindowRedrawRequestedEvent), Resized(WindowResizedEvent), Moved(WindowMovedEvent), CloseRequested(WindowCloseRequestedEvent), Destroyed(WindowDestroyedEvent), DroppedFile(WindowDroppedFileEvent), HoveredFile(WindowHoveredFileEvent), HoveredFileCancelled(WindowHoveredFileCancelledEvent), FocusGained(WindowFocusGainedEvent), FocusLost(WindowFocusLostEvent), KeyboardInput(WindowKeyboardInputEvent), TextInput(WindowTextInputEvent), MouseEnter(WindowMouseEnterEvent), MouseLeave(WindowMouseLeaveEvent), MouseMove(WindowMouseMoveEvent), MouseButton(WindowMouseButtonEvent), MouseWheel(WindowMouseWheelEvent), AxisMotion(WindowAxisMotionEvent), TouchpadPressure(WindowTouchpadPressureEvent), TouchpadMagnify(WindowTouchpadMagnifyEvent), TouchpadRotate(WindowTouchpadRotateEvent), Touch(WindowTouchEvent), ScaleFactorChanged(WindowScaleFactorChangedEvent), ThemeChanged(WindowThemeChangedEvent),
}
Expand description

Window event.

Variants§

§

RedrawRequested(WindowRedrawRequestedEvent)

A redraw was requested by the OS or application code.

§

Resized(WindowResizedEvent)

A window was resized.

§

Moved(WindowMovedEvent)

A window was moved.

§

CloseRequested(WindowCloseRequestedEvent)

A window was closed.

§

Destroyed(WindowDestroyedEvent)

A window was destroyed.

§

DroppedFile(WindowDroppedFileEvent)

A file was dropped on a window.

§

HoveredFile(WindowHoveredFileEvent)

A file is being hovered over a window.

§

HoveredFileCancelled(WindowHoveredFileCancelledEvent)

A file that was being hovered over a window was canceled..

§

FocusGained(WindowFocusGainedEvent)

A window gained input focus.

§

FocusLost(WindowFocusLostEvent)

A window lost input focus.

§

KeyboardInput(WindowKeyboardInputEvent)

A window received keyboard input.

§

TextInput(WindowTextInputEvent)

A window received text input.

§

MouseEnter(WindowMouseEnterEvent)

The mouse cursor entered a window.

§

MouseLeave(WindowMouseLeaveEvent)

The mouse cursor left a window.

§

MouseMove(WindowMouseMoveEvent)

The mouse cursor was moved on a window.

§

MouseButton(WindowMouseButtonEvent)

A mouse button was pressed or released on a window.

§

MouseWheel(WindowMouseWheelEvent)

A window received mouse wheel input.

§

AxisMotion(WindowAxisMotionEvent)

A window received axis motion input.

§

TouchpadPressure(WindowTouchpadPressureEvent)

A window received touchpad pressure input.

§

TouchpadMagnify(WindowTouchpadMagnifyEvent)

A window received a touchpad magnify event.

On supported platforms, the event is triggered moving two fingers towards or away from each-other on the touchpad.

Platform specific: Only available on macOS.

§

TouchpadRotate(WindowTouchpadRotateEvent)

A window received a touchpad rotate event.

On supported platforms, the event is triggered putting two fingers on the touchpad and rotating them.

Platform specific: Only available on macOS.

§

Touch(WindowTouchEvent)

A window received touch input.

§

ScaleFactorChanged(WindowScaleFactorChangedEvent)

The scale factor between logical and physical pixels for a window changed.

§

ThemeChanged(WindowThemeChangedEvent)

The theme for a window changed.

Implementations§

source§

impl WindowEvent

source

pub fn window_id(&self) -> WindowId

Get the window ID of the event.

Trait Implementations§

source§

impl Clone for WindowEvent

source§

fn clone(&self) -> WindowEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WindowEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<WindowAxisMotionEvent> for WindowEvent

source§

fn from(other: WindowAxisMotionEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowCloseRequestedEvent> for WindowEvent

source§

fn from(other: WindowCloseRequestedEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowDestroyedEvent> for WindowEvent

source§

fn from(other: WindowDestroyedEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowDroppedFileEvent> for WindowEvent

source§

fn from(other: WindowDroppedFileEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowEvent> for Event

source§

fn from(other: WindowEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowFocusGainedEvent> for WindowEvent

source§

fn from(other: WindowFocusGainedEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowFocusLostEvent> for WindowEvent

source§

fn from(other: WindowFocusLostEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowHoveredFileCancelledEvent> for WindowEvent

source§

fn from(other: WindowHoveredFileCancelledEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowHoveredFileEvent> for WindowEvent

source§

fn from(other: WindowHoveredFileEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowKeyboardInputEvent> for WindowEvent

source§

fn from(other: WindowKeyboardInputEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowMouseButtonEvent> for WindowEvent

source§

fn from(other: WindowMouseButtonEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowMouseEnterEvent> for WindowEvent

source§

fn from(other: WindowMouseEnterEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowMouseLeaveEvent> for WindowEvent

source§

fn from(other: WindowMouseLeaveEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowMouseMoveEvent> for WindowEvent

source§

fn from(other: WindowMouseMoveEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowMouseWheelEvent> for WindowEvent

source§

fn from(other: WindowMouseWheelEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowMovedEvent> for WindowEvent

source§

fn from(other: WindowMovedEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowRedrawRequestedEvent> for WindowEvent

source§

fn from(other: WindowRedrawRequestedEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowResizedEvent> for WindowEvent

source§

fn from(other: WindowResizedEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowScaleFactorChangedEvent> for WindowEvent

source§

fn from(other: WindowScaleFactorChangedEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowTextInputEvent> for WindowEvent

source§

fn from(other: WindowTextInputEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowThemeChangedEvent> for WindowEvent

source§

fn from(other: WindowThemeChangedEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowTouchEvent> for WindowEvent

source§

fn from(other: WindowTouchEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowTouchpadMagnifyEvent> for WindowEvent

source§

fn from(other: WindowTouchpadMagnifyEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowTouchpadPressureEvent> for WindowEvent

source§

fn from(other: WindowTouchpadPressureEvent) -> Self

Converts to this type from the input type.
source§

impl From<WindowTouchpadRotateEvent> for WindowEvent

source§

fn from(other: WindowTouchpadRotateEvent) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSync for T
where T: Sync,