Event is an enumeration of the effects that a user can have on a running Window.
TODO: Add support for more events like touch events and window resizes.
Keyboard is either a keypress or a keyrelease. The is_down
bool tells you which :)
Fields of Keyboard
Mouse can be either a click or a click release. Refer to is_down
. Note that the position
of the mouse at the time of the click is listed. The mouse may have moved in the meantime,
so for precision, you can use the position fields on this variant.
Fields of Mouse
The user has signaled to the OS that the application should be killed. This could happen
through clicking the X in the corner of the window or using CMD-Q or Alt-F4 (depending on
the platform).
You normally do not have to catch this event yourself. Window has built-in code to process
this case.
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
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
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static