joseph/Monocle — pull request #216 by danshultz (2013-07-19 19:38:41+00:00)
Title: Contact event rework

This commit addresses issues with Microsoft products (IE8, Surface, etc) not handling events correctly due to incorrect event detection. It also address the github issue #204 where on some android devices, swiping fails, etc.

Swiping would fail due to a mouse event firing first and the listener would subscribe to mouse events instead of touch events.

* Microsoft products do bat shit crazy events where touches/mouse/other events get fired in addition to pointer events. In some scenarios, mouse events are not even fired. Per the MS documentation, listen to the pointer events and life will be good…THIS IS WHY WE CAN'T HAVE NICE THINGS
* If a mouse is not supported, don't listen to mouse events. Save the resources and prevent listening on mouse events that are fired in addition to touch events.
* Otherwise, just listen to touch and mouse events regardless to support interfaces that use both touch and mouse handlers

@joseph - I know this is a bit of a revamp of the onContact method so let me know if you would like to discuss further. I've tested this on a handful of devices including IE 10, Surface, Samsung Nexus, Galaxy S, Chrome, Chrome simulating touch events, etc and I think this is a solid solution to properly supporting touch events.

I went with an approach to only listen to touch events on mobile user agents to help clean up event handling so we are not using unnecessary resources on mobile devices. We could bind to mouse events on these devices also but I feel it's unnecessary.