pub enum Event {
Show 15 variants WindowResize, FocusLost, Refresh, Char(char), CtrlChar(char), AltChar(char), Key(Key), Shift(Key), Alt(Key), AltShift(Key), Ctrl(Key), CtrlShift(Key), CtrlAlt(Key), Mouse { offset: Vec2, position: Vec2, event: MouseEvent, }, Unknown(Vec<u8>), // some variants omitted
}
Expand description

Represents an event as seen by the application.

Variants

WindowResize

Event fired when the window is resized.

FocusLost

Event fired when the view is about to lose focus.

Refresh

Event fired regularly when a auto-refresh is set.

Char(char)

Tuple Fields

0: char

A character was entered (includes numbers, punctuation, …).

CtrlChar(char)

Tuple Fields

0: char

A character was entered with the Ctrl key pressed.

AltChar(char)

Tuple Fields

0: char

A character was entered with the Alt key pressed.

Key(Key)

Tuple Fields

0: Key

A non-character key was pressed.

Shift(Key)

Tuple Fields

0: Key

A non-character key was pressed with the Shift key pressed.

Alt(Key)

Tuple Fields

0: Key

A non-character key was pressed with the Alt key pressed.

AltShift(Key)

Tuple Fields

0: Key

A non-character key was pressed with the Shift and Alt keys pressed.

Ctrl(Key)

Tuple Fields

0: Key

A non-character key was pressed with the Ctrl key pressed.

CtrlShift(Key)

Tuple Fields

0: Key

A non-character key was pressed with the Ctrl and Shift keys pressed.

CtrlAlt(Key)

Tuple Fields

0: Key

A non-character key was pressed with the Ctrl and Alt keys pressed.

Mouse

Fields

offset: Vec2

Position of the top-left corner of the view receiving this event.

position: Vec2

Position of the mouse when this event was fired.

event: MouseEvent

The mouse event itself.

A mouse event was sent.

Unknown(Vec<u8>)

Tuple Fields

0: Vec<u8>

An unknown event was received.

Implementations

Returns the position of the mouse, if self is a mouse event.

Returns a mutable reference to the position of the mouse/

Returns None if self is not a mouse event.

Update self with the given offset.

If self is a mouse event, adds top_left to its offset. Otherwise, do nothing.

Returns a cloned, relativized event.

If self is a mouse event, adds top_left to its offset. Otherwise, returns a simple clone.

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

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. 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)

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.