DebounceCounter:
Filter:
Classes (extension) | Utilities

DebounceCounter
ExtensionExtension

A function debounce counter. good for double click detection
Location: NOT INSTALLED!

Description

A debounce counter for functions. Has an option to fire immediately. The mouseDownAction of View contains a clickCount, but it is currently useless, because its interval between clicks is much too long. Unless you wait several seconds, you always get a double click.

You can use DebounceCounter to only execute the function every nth time within a certain period. This means you can use mouseUpAction too, which has no clickCount, and is much better for use in lists or TreeViews. See the example below. You can use it for other things too, of course, like for games.

Class Methods

.new

defaults are set for double-click detection

Returns:

a DebounceCounter

Inherited class methods

Instance Methods

.reset

resets the counter to 0

.trigger

triggers the function after counter attempts within the wait period

Inherited instance methods

Examples