Skip to main content

Module press

Module press 

Source
Expand description

When a press has become a drag.

This is one number and one comparison, and it is here on purpose. Whether a press is still a click decides three separate things — whether a gesture has started, whether releasing counts as a click, and when the pointer may be captured — and the last of those is easy to get wrong: capturing on the press itself makes the browser re-target click and dblclick at the capturing element, so every double-click on anything inside the surface is lost. Capture belongs to a drag, not to a press, and Press::is_drag is what says which one is in hand.

Structs§

Press
The press a gesture began with.

Constants§

COARSE_THRESHOLD
The same for touch and pen, which are noisier.
PRECISE_THRESHOLD
How far a mouse or trackpad must travel before a press is a drag, in surface pixels.