class
TUI::ClickTracker
- TUI::ClickTracker
- Reference
- Object
Overview
Tracks repeated clicks on the same logical target (e.g. a list row index) to detect a double-click, independent of scrolling/rendering — a double-click doesn't require its target to be scrollable.
Defined in:
tui/widget/click_tracker.crConstant Summary
-
DEFAULT_THRESHOLD =
400.milliseconds -
Max gap between two clicks on the same target for #register to treat them as a double-click. Overridable per instance via #initialize's
thresholdargument.
Constructors
Instance Method Summary
-
#register(target : Int32) : Bool
Register a click on
target.
Constructor Detail
Instance Method Detail
def register(target : Int32) : Bool
#
Register a click on target. Returns true if this click completes a
double-click (same target, within @threshold of the previous
click) — and on a true double-click, resets internal state so a
third rapid click starts a fresh pair rather than chaining. Returns
false otherwise (recording this click as the new "last click").