var direction = directionStr(input.direction);
1815 input.additionalEvent = this.options.event + direction; 1817 this._super.emit.call(this, input); 1823 * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out). 1825 * @extends AttrRecognizer 1827 function PinchRecognizer() { 1828 AttrRecognizer.apply(this, arguments); 1831 inherit(PinchRecognizer, AttrRecognizer, { 1834 * @memberof PinchRecognizer 1842 getTouchAction: function() { 1843 return [TOUCH_ACTION_NONE]; 1846 attrTest: function(input) { 1847 return this._super.attrTest.call(this, input) && 1848 (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN); 1851 emit: function(input) { 1852 if (input.scale !== 1) { 1853 var inOut = input.scale < 1 ? 'in' : 'out'; 1854 input.additionalEvent = this.options.event + inOut; 1856 this._super.emit.call(this, input); 1862 * Recognized when the pointer is down for x ms without any movement. 1864 * @extends Recognizer 1866 function PressRecognizer() { 1867 Recognizer.apply(this, arguments); 1873 inherit(PressRecognizer, Recognizer, { 1876 * @memberof PressRecognizer 1881 time: 251, // minimal time of the pointer to be pressed 1882 threshold: 9 // a minimal movement is ok, but keep it low 1885 getTouchAction: function() { 1886 return [TOUCH_ACTION_AUTO]; 1889 process: function(input) { 1890 var options = this.options; 1891 var validPointers = input.pointers.length === options.pointers; 1892 var validMovement = input.distance < options.threshold; 1893 var validTime = input.deltaTime > options.time; 1895 this._input = input; 1897 // we only allow little movement 1898 // and we've reached an end event, so a tap is possible 1899 if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {