Static
createCreates a new instance of PointerWatcher with the given PointerWatcherConfig. It does not save it for future reuse.
Static
reuseReturns an existing instance of PointerWatcher with the given PointerWatcherConfig, or creates a new one.
NOTE: It saves it for future reuse, so don't use this for temporary short-lived watchers.
Readonly
offRemoves previously added handlers.
Readonly
onCall the startHandler
whenever the pointer action begins.
Call the endHandler
whenever the pointer action ends. If endHandler
is
not given, it defaults to startHandler
.
For an explanation of what "begins" and "ends" means for each supported action, see OnPointerOptions.actions.
IMPORTANT: The same handlers can not be added multiple times for the same event target, even if the options differ. If the handler has already been added for this target, then it will be removed and re-added with the current options.
PointerWatcher listens for simple pointer actions like clicks, press and hold or hover.