Trying to get event handling correct for a web app that should work equally well with mouse and touch events, I started using pointer events where mouse and touch handling should be basically the same. Yet this sometimes interferes in weird ways with default bindings. To better understand how to correctly avoid this I have the following
Question: can anyone point to a write-up or spec describing things like:
- in which order do we get pointer, mouse, touch events for the same user interaction on devices which support them
- is there a way to tell for, say, a pointer and a mouse event that they originate from the same user interaction
- will same-user-interaction events bubble interleaved or one after the other
Alternatively I am happy to get write-ups here. Maybe the whole relation between those events and how they are (typically) handled can be described more concise than I assume.
Touch Events W3C recommendation were introduced by Apple with the release of iOS 2.0 in 2008. Touch events translate touch screen input (and only touch screen input) to events similar to the traditional mouse events (touchstart=mousedown, touchend=mouseup).
Pointer Events W3C recommendation encapsulate a whole bunch of input methods in one single layer of abstraction. Mouse, touch and pen input are all translated to one common “pointer” event the application can react to.
Pointer events are not supported by all browsers, see this.