new PointerManager(target [, options])
Creates a new PointerManager instance.
Parameters:
Name | Type | Argument | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
target |
HTMLElement | DOM element to attach event listeners to |
||||||||||||||||
options |
Object |
<optional> |
Configuration options Properties
|
- Source:
Fires:
- PointerManager#event:fingerHover - Triggered when a pointer moves over a target.
- PointerManager#event:fingerSingleTap - Triggered on a quick touch or click.
- PointerManager#event:fingerDoubleTap - Triggered on two quick touches or clicks.
- PointerManager#event:fingerHold - Triggered when a touch or click is held for more than 600ms.
- PointerManager#event:mouseWheel - Triggered when the mouse wheel is rotated.
- PointerManager#event:panStart - Triggered when a pan (drag) gesture begins.
- PointerManager#event:panMove - Triggered during a pan gesture.
- PointerManager#event:panEnd - Triggered when a pan gesture ends.
- PointerManager#event:pinchStart - Triggered when a pinch gesture begins.
- PointerManager#event:pinchMove - Triggered during a pinch gesture.
- PointerManager#event:pinchEnd - Triggered when a pinch gesture ends.
Members
-
<static, readonly> ANYPOINTER :number
-
Constant for targeting all pointers.
Type:
- number
- Source:
Methods
-
off(eventTypes, callback [, idx])
-
Unregisters event handlers.
Parameters:
Name Type Argument Default Description eventTypes
string Space-separated list of event types
callback
Object | function Handler to remove
idx
number <optional>
ANYPOINTER Pointer index to target
- Source:
-
on(eventTypes, obj [, idx])
-
Registers event handlers.
Parameters:
Name Type Argument Default Description eventTypes
string Space-separated list of event types
obj
Object | function Handler object or function
idx
number <optional>
ANYPOINTER Pointer index to target, or ANYPOINTER for all
- Source:
Returns:
Handler object
- Type
- Object
-
onEvent(handler)
-
Registers a complete event handler with multiple callbacks.
Parameters:
Name Type Description handler
Object Handler object
Properties
Name Type Argument Description priority
number Handler priority (higher = earlier execution)
fingerHover
function <optional>
Hover callback
fingerSingleTap
function <optional>
Single tap callback
fingerDoubleTap
function <optional>
Double tap callback
fingerHold
function <optional>
Hold callback
mouseWheel
function <optional>
Mouse wheel callback
panStart
function <optional>
Pan start callback
panMove
function <optional>
Pan move callback
panEnd
function <optional>
Pan end callback
pinchStart
function <optional>
Pinch start callback
pinchMove
function <optional>
Pinch move callback
pinchEnd
function <optional>
Pinch end callback
- Source:
Throws:
-
If handler lacks priority or required callbacks
- Type
- Error
-
onPan(handler)
-
Registers callbacks for pan gestures (start, move, and end).
Parameters:
Name Type Description handler
Object The handler object containing pan gesture callbacks.
Properties
Name Type Description panStart
function Callback function executed when the pan gesture starts.
panMove
function Callback function executed during the pan gesture movement.
panEnd
function Callback function executed when the pan gesture ends.
- Source:
Throws:
-
Throws an error if any required callback functions (
panStart
,panMove
,panEnd
) are missing. - Type
- Error
-
onPinch(handler)
-
Registers callbacks for pinch gestures (start, move, and end).
Parameters:
Name Type Description handler
Object The handler object containing pinch gesture callbacks.
Properties
Name Type Description pinchStart
function Callback function executed when the pinch gesture starts.
pinchMove
function Callback function executed during the pinch gesture movement.
pinchEnd
function Callback function executed when the pinch gesture ends.
- Source:
Throws:
-
Throws an error if any required callback functions (
pinchStart
,pinchMove
,pinchEnd
) are missing. - Type
- Error