simulate-touch

1.0.0 • Public • Published

simulate-touch

Fire touch events when corresponding mouse events fire.

  • mousedown -> touchstart
  • mousemove -> touchmove
  • mouseup -> touchend

Install

$ npm install simulate-touch

Usage

var simulateTouch = require('simulate-touch')
 
simulateTouch(document.body)
 
document.body.addEventListener('touchstart', function () {
  console.log('touch start')
})
 
document.body.dispatchEvent([mousedown event])
// touch started

See test.js for more info.

Package Sidebar

Install

npm i simulate-touch

Weekly Downloads

25

Version

1.0.0

License

BSD

Last publish

Collaborators

  • tehshrike