Pointer events - Mobile Web Development

Pointer events – Mobile Web Development



to rectify this situation Microsoft made a standards proposal that reconciles touch events and mouse events and pen input two into one model called pointer events so you'll notice that pointer events are currently only natively implemented on Internet Explorer and ie mobile for all the other browsers out there you're going to need a polyfill library built on top of touch events luckily there's a great polyfill library out there as part of the polymer project this is what I use to implement pointer event handling in my synthesizer the set of pointer events should look pretty familiar to you if you've used Mouse events before they basically map all the mouse events directly and then add the pointer cancel event from touch as well the pointer event itself derives from Mouse event so it gets all the same coordinates as Mouse events as well as a few things from touch it has a unique pointer ID similar to that touch ID we saw in touch events and it also has a width and a height of the touch point in Touch cases for pen cases it may have pressure or tilt and of course the pointer event tells you what type of pointer it is whether it's a mouse pointer or a touch pointer or a pen input

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *