Skip to main content

Crate wgame_input

Crate wgame_input 

Source
Expand description

Input for a drawing area, independent of a windowing or UI backend.

Positions and scrolling use local logical pixels, X right and Y down. Adapters produce one CanvasInput per application frame. Events retain the order supplied by that adapter, not necessarily the original OS event history. A canvas has one primary pointer (mouse or primary touch), five buttons, and logical keys. Text editing, IME, individual touch IDs and raw device motion belong to the host’s platform/UI API.

Capture belongs to the canvas where a press started. Movement and release may occur outside its bounds. Event::Cancelled ends all held interactions on focus loss, geometry changes, or removal; it must not activate a click action.

Structs§

CanvasInput
Immutable input paired with one content frame.
InputState
Adapter-side accumulator. Clearing a frame keeps held state; cancellation clears held state and emits an explicit cancellation instead of fake releases.
Modifiers

Enums§

Button
Event
Key
Logical key; letters are lowercase, independent of Shift. Use platform events for physical key locations. Text entry should be handled by the UI host.