1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! A gesture recognizer that every host shares: pointer, touch, platform
//! pinch and other camera input turned into camera moves on a
//! [`GestureCamera`], such as `mln_runtime::Map`, through the map's camera
//! calls with their gesture phases
//! ([`Map::apply_camera_delta`](crate::map::Map::apply_camera_delta)), and
//! releases continued with the map's momentum. Hosts translate each platform
//! event into an [`Input`]: which buttons and keys map to a pointer's
//! [`DragAction`], [`PointerFlags`] and [`Modes`], and how far a wheel, a dial
//! or a key moves the camera. The recognizer interprets them over time, and
//! reports what gestures mean beyond camera moves as [`GestureEvent`]s: taps,
//! which hosts answer, and the notches where hosts play haptic feedback.
//! [`GestureOptions`] separates camera-axis rules ([`GestureAxes`]),
//! per-gesture behavior ([`GestureBehavior`]), and platform/accessibility
//! metrics ([`GestureMetrics`]).
//!
//! Hosts feed [`Input`]s with their timestamps and call
//! [`GestureRecognizer::tick`] when it asks. The recognizer keeps no clock
//! or thread of its own.
//!
//! Hosts read two clocks each frame: the recognizer's, in milliseconds on any
//! clock their input events use (`performance.now()`, an `Instant`), which
//! times taps, releases and scrolls; and the map's `Instant::now()`, which they
//! give the map's frame time (`mln_runtime::RenderSession`'s frames) and which times
//! the camera's animations. The two never meet, so their epochs don't
//! matter.
pub use ;
pub use ;
pub use ;
pub use ;