Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Introducing pointer.js

75 views
Skip to first unread message

Matt Claypotch

unread,
May 24, 2013, 5:12:06 PM5/24/13
to dev-w...@lists.mozilla.org
A common problem web developers face is abstracting mouse and touch events.
You can do feature detection, but some devices will issue both! To help
alleviate this, I created pointer.js, located at
https://github.com/mozilla/pointer.js .
It uses CustomEvent to create a 'pointer' type of event that abstracts
mouse and touch events. The main feature of note is a 'pointerclick' event
that uses various heurstics to have a responsive touch event that is
resistant to errant clicks from scrolling or finger grazes.

Try it out and let me know what you think! Pull Requests/Issues/feedback
very welcome.

~potch

David Ascher

unread,
May 24, 2013, 5:14:34 PM5/24/13
to m...@potch.me, dev-w...@lists.mozilla.org
Cool. Can you compare and contrast with something like hammer.js?

-- da
(typed with thumbs)

~potch
_______________________________________________
dev-webapps mailing list
dev-w...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-webapps

Matt Claypotch

unread,
May 24, 2013, 5:35:37 PM5/24/13
to dascher, dev-w...@lists.mozilla.org
I will test out hammer.js and report back!

Without testing, the differences are:
* hammer.js support *way* more events
* hammer.js is 10 times the size of pointer.js (minified to minified)

I'll evaluate performance on B2G, but pointer.js was built with B2G perf in
mind.

Thanks for pointing that lib out!

~potch

Anthony Ricaud

unread,
May 25, 2013, 9:32:45 AM5/25/13
to
See also the polyfill by Microsoft for the Pointer Event spec:
http://handjs.codeplex.com/

Also, note that Firefox and Chrome (maybe others) have a no-delay click
event when you use a fixed viewport.
0 new messages