Skip to main content

Module interaction_manager

Module interaction_manager 

Source
Expand description

Engine-owned interaction manager that automates hover, leave, click, and selection lifecycle bookkeeping.

The InteractionManager sits between the host event loop and the engine’s pick/query APIs. Each frame the host feeds raw pointer events (update_pointer_move, update_pointer_down, update_pointer_up, update_pointer_leave) and the manager emits high-level InteractionEvents via drain_events.

§Design goals

  • No host-side hover bookkeeping. Enter/leave transitions are diffed internally so the host never tracks previous targets.
  • Click-vs-drag suppression. Pointer-down followed by movement beyond a configurable pixel threshold is treated as a drag - no Click event is emitted.
  • Double-click timing. Two Click events within a configurable time window produce a DoubleClick.
  • Layer filtering. An optional set of interactive layer ids restricts which layers participate in automatic hover/select queries.
  • Backend-neutral. Works identically in Bevy and pure WGPU integrations.

Structs§

InteractionConfig
Tuning knobs for the interaction manager.
InteractionManager
Stateful runtime that interprets raw pointer input and emits high-level InteractionEvents.