Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pointer-tracker

> 编程语言
Open source

Track mouse/touch/pointer events for a given element.

191 stars0 likes0 views
WebsiteGitHub

About

Track mouse/touch/pointer events for a given element.

PointerTracker

Track mouse/touch/pointer events for a given element.

API

PointerTracker

…

Pointer

javascript
const pointer = pointerTracker.currentPointers[0];

// x offset from the top of the document
pointer.pageX;
// y offset from the top of the document
pointer.pageY;
// x offset from the top of the viewport
pointer.clientX;
// y offset from the top of the viewport
pointer.clientY;
// Unique ID for this pointer
pointer.id;
// The platform object used to create this Pointer
pointer.nativePointer;
// Returns an expanded set of Pointers for high-resolution inputs.
const pointers = pointer.getCoalesced();

Demo

A simple painting app (code).

Files

  • lib/index.ts - Original TypeScript.
  • dist/PointerTracker.mjs - JS module. Default exports PointerTracker.
  • dist/PointerTracker.js - UMD JS. Exposes PointerTracker on the global by default.
  • dist/PointerTracker-min.js - Minified UMD JS. ~900 bytes brotli'd.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言