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 too, 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 poly fill library built on top of touch events. Luckily, there’s a great poly fill library out there as part of the polymer project. This is what I used to implement pointer event handling in my synthesizer. The set of pointer events should look pretty familiar to you if you 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 pionter event tells you what type of pointer it is, whether it’s a mouse pointer or a touch pointer or a pen input.

Be the first to comment

Leave a Reply

Your email address will not be published.


*