pointerType property

0 out of 3 rated this helpful - Rate this topic

Returns whether the source of the event is touch, pen or mouse.

This property is read-only.

Syntax

JavaScript
ptr = object.pointerType

Property values

Type: Integer

MSPOINTER_TYPE_TOUCH (0x00000002)

MSPOINTER_TYPE_PEN (0x00000003)

MSPOINTER_TYPE_MOUSE (0x00000004)

Remarks

The following example uses pointerType to check whether a pointer is primary from inside events other than onmspointerdown.


elm.addEventListener("MSPointerDown",handleDown,false);
function handleDown(evt) {
  if(evt.pointerType == evt.MSPOINTER_TYPE_TOUCH) {
    // Do something for touch input only
  }else{
    // Do something for non-touch input
  }
}


See also

MSPointerEvent
isPrimary

 

 

Build date: 11/29/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.