Compartilhar via


onmspointercancel event

Fires when the system cancels a pointer event.

 

Syntax

HTML Attribute <element onmspointercancel = "handler(event)">
addEventListener Method object.addEventListener("MSPointerCancel", handler, useCapture)

 

Event handler parameters

  • handler [in]
    Type: Function

    Function to run when the event is triggered.

Remarks

This event occurs when the pointer (touch or pen contact) is removed from the system. Here are common reasons why this might happen:

  • A touch contact is canceled by a pen coming into range of the surface.
  • The device doesn't report an active contact for more than 100ms.
  • A mapping for a device's monitor changes while contacts are active. For example, the user changes the position of a screen in a two screen configuration.
  • The desktop is locked or the user logged off.
  • The number of simultaneous contacts exceeds the number that the device can support. For example, if a device supports only two contact points, if the user has two fingers on a surface, and then touches it with a third finger, this event is raised.

When the onmspointercancel event is raised for a pointer, the app won’t receive any other events for that pointer, including onmspointerup . The app should perform any necessary cleanup as required for the pointer. For example, if the app maintains a pointer list, the app should remove the pointer from the list.

You shouldn't treat this event like an onmspointerup event. When a pointer is removed, the app should cancel any ongoing work. The following example shows how you might handle pointer events if the target is a button:

  • When the app receives an MSPointerDown event, highlight the button, and then show the button as pressed
  • When the app receives an MSPointerUp (completed action) event remove the highlighting for the button and then show the button as raised, and execute the button's click handler
  • When the app receives an onmspointercancel (aborted action) event, remove the highlighting for the button, show the button as raised, do any necessary clean up, and don't execute the button's click handler.

Note  For more information about controlling touch behavior and using multi-touch, see Guidelines for Building Touch-friendly Sites.

 

See also

onmspointerdown

onmspointerup

IHTMLCSSStyleDeclaration2::msTouchAction

onmsgesturehold