A lightweight JavaScript library for unified mouse, touch, and pointer event tracking on DOM elements.
PointerTracker is a JavaScript library that unifies mouse, touch, and pointer event tracking for DOM elements. It solves the problem of handling multiple input types consistently across browsers, providing a simple API to manage pointer states and events for interactive web applications.
Frontend developers building interactive features like drawing apps, drag-and-drop interfaces, or multi-touch gestures that require reliable cross-platform input handling.
Developers choose PointerTracker for its lightweight size, straightforward API, and automatic handling of browser inconsistencies in pointer events, eliminating the need to write repetitive cross-platform event logic.
Track mouse/touch/pointer events for a given element.
Abstracts mouse, touch, and pointer events into a single interface, automatically handling browser inconsistencies as highlighted in the README's feature list.
Maintains ordered startPointers and currentPointers arrays, preserving pointer state and order for reliable gesture tracking, as detailed in the API section.
Offers rawUpdates for desynchronized canvases and avoidPointerEvents to work around browser bugs, providing optimizations for different use cases per the README options.
Minified UMD version is approximately 900 bytes brotli'd, ensuring negligible impact on load times as stated in the files section.
Lacks pre-implemented gestures like dragging or multi-touch recognition; developers must build these from scratch using the low-level callbacks, increasing initial effort.
Requires explicit calls to stop() to remove listeners, which can lead to memory leaks if not handled properly in dynamic applications like single-page apps.
Focuses solely on pointer tracking without hooks into UI frameworks or state management, necessitating additional code for complex interactive systems.
Super tiny size multi-touch gestures library for the web. You can touch this →
Detect if a device is mouseOnly, touchOnly, or hybrid, and if the primary input is mouse or touch.
Very small gesture recognizer for JavaScript. Swipe, pan, tap, doubletap, longpress, pinch, and rotate. (Mirror of https://forge.sciactive.com/sciactive/tinygesture)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.