Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

point

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

point

Unified, Observable Touch and Mouse Events

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
152
decreased by-35.86%
Maintainers
1
Weekly downloads
 
Created
Source

point

Use observable to monitor mouse and touch events.

NPM

Usage

First bind to the element you wish to capture data for. In this case let's capture data at the document level:

var point = require('point')(document);

Now to receive the pointer events simply pass point a function that will process the data:

point(function(args) {
  console.log(args);
});

The event data is passed to the function as a 4 element array:

[ pageX, pageY, data, originalEvent ]

At this stage, the data object [2] simply tells you the type of the pointer event, with three possible values:

  • start
  • move
  • end

Keywords

FAQs

Package last updated on 02 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc