Expand description
The Event
enum and assorted supporting types.
These are sent to the closure given to EventLoop::run(...)
, where they get
processed and used to modify the program state. For more details, see the root-level documentation.
Some of these events represent different “parts” of a traditional event-handling loop. You could
approximate the basic ordering loop of EventLoop::run(...)
like this:
ⓘ
let mut start_cause = StartCause::Init;
while !elwt.exiting() {
event_handler(NewEvents(start_cause), elwt);
for e in (window events, user events, device events) {
event_handler(e, elwt);
}
for w in (redraw windows) {
event_handler(RedrawRequested(w), elwt);
}
event_handler(AboutToWait, elwt);
start_cause = wait_if_necessary();
}
event_handler(LoopExiting, elwt);
This leaves out timing details like ControlFlow::WaitUntil
but hopefully
describes what happens in what order.
Structs
- Identifier of an input device.
- Handle to synchroniously change the size of the window from the
WindowEvent
. - Describes a keyboard input targeting a window.
- Describes keyboard modifiers event.
- Describes a keyboard input as a raw device event.
- Represents a touch event
Enums
- Represents raw hardware events that are not associated with any particular window.
- Describes the input state of a key.
- Describes a generic event.
- Describes the force of a touch event
- Describes input method events.
- Describes a button of a mouse controller.
- Describes a difference in the mouse scroll wheel state.
- Describes the reason the event loop is resuming.
- Describes touch-screen input state.
- Describes an event from a
Window
.
Type Aliases
- Identifier for a specific analog axis on some device.
- Identifier for a specific button on some device.