Skip to main content

Module hold

Module hold 

Source
Expand description

VAPP-162 (docs/round-5-contract.md §9): the Button hold gesture as a pure state machine every painter shares (the core drives it through Surface::hold; gpui may also run it directly). With hold: true a press never fires press: pointer down (or Space / Enter key down, key repeat ignored) starts the hold (holdStart, the pressed state, the holdingLabel); release within HOLD_SLOP px of the box (or key up of the key that started it) ends it (holdEnd); the pointer leaving the box by more than the slop, a pointer cancel, Escape or losing focus cancel it (holdCancel); after a cancel nothing fires until the next down. fixtures/interactions-round1.json buttonHold locks it.

Structs§

HoldTracker
One button’s hold.

Enums§

HoldEvent
What a step fired.
HoldInput
One input to a hold. Coordinates are px relative to the button’s top-left; width/height = its laid-out box.

Constants§

HOLD_SLOP
How far (px) the pointer may wander outside the box while held.