Skip to main content

Module input

Module input 

Source
Expand description

Input event types — the engine’s public input API.

Like Chrome’s blink/public/common/input/ — these types define the contract between the platform layer and the engine. The platform converts OS events (winit) into these types, then passes them to FrameWidget.

§Architecture

Layer 0: winit events          (OS abstraction)
Layer 1: input::InputEvent     (THIS MODULE — engine's public API)
         Crosses the main→view thread boundary.
         Self-contained data, no pointers, no handles.
Layer 2: DOM Event             (events/ module — Event, MouseEvent, KeyboardEvent)
         Created by EventHandler from InputEvent.
         Spec-compliant, dispatched through the DOM tree.

§Why these types live in the engine (not the platform)

Chrome defines WebInputEvent in blink (the engine), not in content (the platform). This prevents circular dependencies: the engine defines the types, the platform produces them, and the engine consumes them.

Re-exports§

pub use keyboard::KeyCode;
pub use keyboard::KeyboardEvent;
pub use modifiers::Modifiers;
pub use mouse::ButtonState;
pub use mouse::MouseButton;
pub use mouse::MouseButtonEvent;
pub use mouse::MouseEnterEvent;
pub use mouse::MouseLeaveEvent;
pub use mouse::MouseMoveEvent;
pub use wheel::WheelDelta;
pub use wheel::WheelEvent;

Modules§

keyboard
Keyboard event types.
modifiers
Modifier key state — tracks which modifier keys are held.
mouse
Mouse event types — dedicated structs per event kind.
wheel
Wheel (scroll) event types.

Enums§

InputEvent
An input event — the engine’s entry point for user interaction.