pub struct Reader {
down: BTreeMap<PointerId, Pos2>,
press: Option<Press>,
fingers: Fingers,
span: Option<Span>,
pan_key: PanKey,
shift: Shift,
at: Option<Pos2>,
}Expand description
The latches a stream of DOM events needs to be read through: which pointers are down and where, what the press in progress drives, where the two-finger gesture stood, whether the pan key is held, and where the pointer last was.
Fields§
§down: BTreeMap<PointerId, Pos2>§press: Option<Press>§fingers: Fingers§span: Option<Span>§pan_key: PanKey§shift: Shift§at: Option<Pos2>Implementations§
Source§impl Reader
impl Reader
Sourcepub fn pan_key(&self) -> PanKey
pub fn pan_key(&self) -> PanKey
Whether the pan key is held, as of the last batch — what a host draws the grab cursor from.
Sourcepub fn fingers(&self) -> Fingers
pub fn fingers(&self) -> Fingers
How many pointers the gesture in flight has, as of the last batch.
pub fn read(&mut self, samples: &[Sample], focus: Focus) -> Read
Sourcefn pointer(
&mut self,
sample: &PointerSample,
raw: &mut Vec<Raw>,
moves: &mut Vec<Move>,
) -> bool
fn pointer( &mut self, sample: &PointerSample, raw: &mut Vec<Raw>, moves: &mut Vec<Move>, ) -> bool
One pointer sample, answering whether the camera owns the frame.
Sourcefn lifted(&mut self, id: PointerId)
fn lifted(&mut self, id: PointerId)
A pointer that is no longer down, and the gesture it leaves behind: one finger of a pair is no pinch, so the pair’s span goes with it.
Sourcefn spanned(&self) -> Option<Span>
fn spanned(&self) -> Option<Span>
The pair the gesture is read from, or None for fewer than two
pointers down. A third finger joining does not take the gesture out
from under the two that are holding it.