So in Actionscript 3 and Javascript, to get touch events working for mobile devices I have to listen for ontouch events… However, touch events not fired on desktop.
However, mouse events are triggered on both mobile AND desktop.
My quesion is this: why does w3 have this spec
Wouldn’t it make sense to have just to use the onmouseevent? In order to have things work on mobile and desktop I always have to listen for both events – obviously this causes issue on mobile devices because two events are fired when i press the screen (meaning that I have to do a bunch of conditional checking to add/remove event)
My initial thoughts were that multi-touch would be the main reason… But couldn’t the design just have some parameter of the event like .touches? That could go along with the .pressure, .finger width, etc… maybe a .type = “touch” or .type=”mouse”
I’m sure a lot of thought went into having touch events, so I’d bet there are some valid reasons.
The W3C has published an initial draft of a specification that combines mouse and touch events into a single family of Pointer Events.
Windows 8 and IE10 currently ship with support for this unified event style.