unipointer
Do one thing with one pointer
Last updated 4 years ago by desandro .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install unipointer 
SYNC missed versions from official npm registry.

Unipointer

Base class for doing one thing with pointer event

Used with Unidragger and TapListener

Install

Bower: bower install unipointer

npm: npm install unipointer

Usage

// create new class
function PointerFun( elem ) {
  this.element = elem;
  // binds mousedown/touchstart/pointerdown event
  this._bindStartEvent( this.element, true );
}
// inherit Unipointer
PointerFun.prototype = new Unipointer();

// overwrite public pointer methods
PointerFun.prototype.pointerDown = function( event, pointer ) {
  console.log('pointer down');
};

PointerFun.prototype.pointerMove = function( event, pointer ) {
  console.log('pointer move');
};

PointerFun.prototype.pointerUp = function( event, pointer ) {
  console.log('pointer up');
};

PointerFun.prototype.pointerCancel = function( event, pointer ) {
  console.log('pointer cancel');
};

// triggered on pointerUp and pointerCancel 
PointerFun.prototype.pointerDone = function( event, pointer ) {
  console.log('pointer done');
};

MIT license

By Metafizzy

Current Tags

  • 2.4.0                                ...           latest (4 years ago)

9 Versions

  • 2.4.0                                ...           4 years ago
  • 2.3.0                                ...           8 years ago
  • 2.2.1                                ...           8 years ago
  • 2.2.0                                ...           9 years ago
  • 2.1.0                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 8
This Month 8
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |