Option | Values | Description |
---|---|---|
supportedGestures |
Array[] items can be gesture classes or instances of gesture classes |
Defines which gestures can be recognized |
bubbles |
Boolean true or false |
Turn event bubbling on or off. |
consecutiveGestures |
Boolean true or false |
Allow several gestures after one another without lifting the pointer. |
simultaneousGestures |
Boolean true or false |
Allow two or more gestures at the same time. For example: pinching while rotating. |
handleTouchEvents |
Boolean true or false |
Let PointerListener block default TouchEvents which might interfere with PointerEvents. |
DEBUG |
Boolean true or false |
Show console output of the PointerListener instance. |
DEBUG_GESTURES |
Boolean true or false |
Show console output of the Gesture instances. Displays the recognition process. |
DEBUG_CONTACT |
Boolean true or false |
Show console output of the Contact and PointerInput instances. Displays information about vectors and collected data. |
Event name | Recognizer | Simplified description |
---|---|---|
tap | Tap | fired after pointerUp |
press | Press | fired if pointerDown stays at the same position for a longer time |
pressend | Press | fired when the pointer is relesaed after a press has been detected |
panstart | Pan | fired after pointerDown |
pan | Pan | fired during pointerMove |
panend | Pan | fired after pointerUp, pointerOut or pointerCancel |
swipe | Pan | fired after the pointer left the surface, if the user moved the pointer fast enough at the end of the motion |
swipeleft | Pan | Fired together with swipe, if the pointer was moved to the left at the end of the motion |
swiperight | Pan | Fired together with swipe, if the pointer was moved to the right at the end of the motion |
swipeup | Pan | Fired together with swipe, if the pointer was moved upwards at the end of the motion |
swipedown | Pan | Fired together with swipe, if the pointer was moved downwards at the end of the motion |
pinchstart | Pinch | fired if 2 active pointers (fingers) are present and the distance between those two changed |
pinch | Pinch | fired during changes in distance between 2 pointers (fingers) |
pinchend | Pinch | fired if 2 active pointers (fingers) had been present pinching, and one of them is removed |
rotatestart | Rotate | fired if 2 active pointers (fingers) are present and are moved in a circular motion |
rotate | Rotate | fired during changes in rotation performed with 2 pointers (fingers) |
rotateend | Rotate | fired if 2 active pointers (fingers) had been present rotating, and one of them is removed |
twofingerpanstart | TwoFingerPan | fired if 2 active pointers (fingers) are present and an initial, parallel movement in the same direction occurs |
twofingerpan | TwoFingerPan | fired during the parallel movement of 2 fingers |
twofingerpanend | TwoFingerPan | fired if 2 active pointers (fingers) had been present panning, and one of them is removed |
Name | Usage Example | Description |
---|---|---|
.on( eventType, handlerReference) |
|
attaches an event listener to pointerListener.domElement |
.off( eventType, handlerReference) |
|
removes a previously attached handlerReference |
.destroy() |
|
Unbinds all events and input events and makes PointerListener unusable. |
Name | Value |
---|---|
DIRECTION_LEFT | "left" |
DIRECTION_LEFT | "left" |
DIRECTION_RIGHT | "right" |
DIRECTION_UP | "up" |
DIRECTION_DOWN | "down" |
DIRECTION_HORIZONTAL | [DIRECTION_LEFT, DIRECTION_RIGHT] |
DIRECTION_VERTICAL | [DIRECTION_UP, DIRECTION_DOWN] |
DIRECTION_ALL | [DIRECTION_UP, DIRECTION_DOWN, DIRECTION_LEFT, DIRECTION_RIGHT] |
DIRECTION_CLOCKWISE | 1 |
DIRECTION_COUNTER_CLOCKWISE | -1 |