touch-events
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/touch-events package

0.0.7 • Public • Published

Touch Events

Touch Events on PEP.

Usage

Using JSPM (ECMAScript / ES6 Module)

Install the library.

jspm install touch-events=github:casperlamboo/TouchEvents

Include the library.

import touchEvents from 'touch-events';

Using NPM (CommonJS module)

Install the library.

npm install touch-events

Include the library.

var touchEvents = require('touch-events');

API

createListener

eventListener:EventDispatcher = touchEvents.createListener(DOMNode)

addEventListener

// gesture regonizers
eventListener.addEventListener('wheel', callback: Function);
eventListener.addEventListener('tap', callback: Function);
eventListener.addEventListener('dragstart', callback: Function);
eventListener.addEventListener('drag', callback: Function);
eventListener.addEventListener('dragend', callback: Function);
eventListener.addEventListener('seconddragstart', callback: Function);
eventListener.addEventListener('seconddrag', callback: Function);
eventListener.addEventListener('seconddragend', callback: Function);
eventListener.addEventListener('multitouchstart', callback: Function);
eventListener.addEventListener('multitouch', callback: Function);
eventListener.addEventListener('multitouchend', callback: Function);
 
// original touch events
eventListener.addEventListener('pointerdown', callback: Function);
eventListener.addEventListener('pointermove', callback: Function);
eventListener.addEventListener('pointerup', callback: Function);

setConfig

touchEvents.setConfig(config: Object)
 
config = {
  DRAG_THRESHOLD: Number = 10;
}

Dependencies (2)

Dev Dependencies (13)

Package Sidebar

Install

npm i touch-events

Weekly Downloads

11

Version

0.0.7

License

ISC

Last publish

Collaborators

  • cappieh