Geeks With Blogs

News profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers

Donate Bitcoins

Check out Elapser from T3rse!
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.

Programming and Learning from SD

Our team was using hammer.js for touch events, mainly the tap event, but found some limitations in how we are using it. A colleague investigated more and decided we should use the Pointer Event Specification and Touch Event Specification contributed by Microsoft. It’s only in  Candidate recommendation and only supported in IE10 and 11 (on 1/9/2014), but there is a polyfill for that called Hand.js.

“Pointer events offer a way to unify handling mouse, touch, and pen input.  This means that we can add a single event listener to an element (e.g. pointerup) that will handle different input types without the delay that exists when using a mouse event binding (e.g. click – mousedown and then mouseup at the same position)” ~ my colleague with his permission

He added a Knockout custom binding to handle the element.addEventListener(“pointerdown” and “pointerup” instead of mouseDown or tap from Hamnmer.

 

It’s working well so far.

Update on 8/25/2014:

Google is dropping support for Pointer Events. The author, Peter Bright says in-conclusion "At one time, Internet Explorer 6 was even more dominant than Mobile Safari now is, and implemented fundamental CSS features in a manner that did not conform with specifications at all. Mozilla stuck to its guns with the fledgling Firefox browser, following the specification rather than trying to fit with the majority browser. While it didn't happen overnight, developers did do the work required to support the new browser. Pointer Events may face an uphill battle, but their cause does not seem quite as impossible as Google has suggested." (emphasis mine).

I hope he's right and that Apple and Google and Microsoft can work together toward a standard. Let's not have Safari become the new IE6. I'm sticking with Pointer Events with HandJs as a polyfill.

Posted on Thursday, January 9, 2014 3:38 PM JavaScript | Back to top


Comments on this post: Pointer Event W3C Specification

No comments posted yet.
Your comment:
 (will show your gravatar)
 


Copyright © Aligned | Powered by: GeeksWithBlogs.net | Join free