Skip to main content

Module pointer

Module pointer 

Source
Expand description

The pointer, resolved: raw motions and button edges in, one Event a frame out.

What a click is, when a press becomes a drag and how close two clicks have to be to be one double-click are decided here, once, with the thresholds a desktop toolkit uses โ€” so a host reports what its pointer did and never what it meant.

Structsยง

Click ๐Ÿ”’
Pressed ๐Ÿ”’
The primary button held: where it went down, when, and what has been made of it since.
Resolver
The state one pointer carries between frames.

Enumsยง

Over ๐Ÿ”’
Whether the pointer is over the canvas: a hover is reported only while it is.
Phase ๐Ÿ”’
What a held press has become.

Constantsยง

MAX_CLICK_DIST ๐Ÿ”’
How far a press may travel and still be a click, in screen points.
MAX_CLICK_DURATION ๐Ÿ”’
How long a press may be held and still be a click.
MAX_DOUBLE_CLICK_DELAY ๐Ÿ”’
How soon after one click a second is a double-click.