Events and Gestures

← Documentation
STRVCT

Event flow, listeners, gesture recognizers, timers, keyboard handling, and drag-and-drop.

STRVCT provides two layers for handling user interaction: event listeners that wrap native DOM events and forward them to handler methods on views, and gesture recognizers that interpret sequences of events as higher-level gestures like taps, pans, and pinches. A managed timer system supports deferred work with both strong and GC-friendly weak timeouts.

Most application code uses gesture recognizers rather than raw event listeners. The gesture system unifies mouse and touch input, handles multi-touch emulation on desktop, and coordinates competing gestures through a global SvGestureManager.

Event Flow

The end-to-end path from a browser event to an application handler.

View →

Event Listeners

Thin wrappers around native DOM events that forward to handler methods on views.

View →

Gesture Recognizers

Higher-level state machines that interpret sequences of events as meaningful gestures.

View →

Timers

Managed timeout system for scheduling deferred work, with support for weak references to avoid preventing garbage collection.

View →

Keyboard and Focus

Keyboard state tracking, modifier-aware key dispatch, and the responder chain for focus management.

View →

Drag and Drop

Browser drag-and-drop support for views and nodes, covering both drop targets and drag sources.

View →