Option | Possible Values | Default | Simplified description |
---|---|---|---|
bubbles |
true false |
true | Turn event bubbling on or off |
supportedButtons |
number[] [0,1,2,3,4,8,16] |
[] |
Has only an effect if the input is made using a mouse. Restricts the recognizer to the corresponding mouse button. Tap uses pointerEvent.button. See mdn pointerEvent.button docs for the button mapping. All other recognizers use pointerEvent.buttons See mdn pointerEvent.buttons docs for the button mapping. |
var options = {
bubbles: false
};
var tapRecognizer = new Tap(domElement, options);
var pointerListener = new PointerListener(domElement, {
supportedGestures : [tapRecognizer]
});
Option | Possible Values | Default | Simplified description |
---|---|---|---|
maxDuration | any number | 200 | If the pointer is longer on the surface than the given number (in milliseconds), Tap becomes invalid. |
maxDistance | any number | 30 | If the pointer is moved more than the given distance in px, Tap becomes invalid. |
var options = {
maxDuration: 200,
maxDistance: 30
};
var tapRecognizer = new Tap(domElement, options);
var pointerListener = new PointerListener(domElement, {
supportedGestures : [tapRecognizer]
});
Option | Possible Values | Default | Simplified description |
---|---|---|---|
minDuration | any number | 600 | If the pointer is removed from the surface before the given number in milliseconds, Press becomes invalid. |
maxDistance | any number | 10 | If the pointer is moved more than the given distance in px, Press becomes invalid. |
Option | Possible Values | Default | Simplified description |
---|---|---|---|
supportedDirections |
DIRECTION_ALL, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL or a list[] with one or more of the following: DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DIRECTION_DOWN |
DIRECTION_ALL | Define the directions which Pan is valid for. |
var panOptions = {
supportedDirections : DIRECTION_HORIZONTAL
};
var panRecognizer = new Pan(domElement, panOptions);
var pointerListener = new PointerListener(domElement, {
supportedGestures : [panRecognizer]
});
var twoFingerPan = new TwoFingerPan(domElement);
var pinch = new Pinch(domElement);
twoFingerPan.block(pinch);
pinch.block(twoFingerPan);
var pointerListener = new PointerListener(domElement, {
supportedGestures : [twoFingerPan, pinch]
});