initPointerEvent

< dom‎ | PointerEvent(Redirected from dom/initPointerEvent)
Jump to: navigation, search

initPointerEvent



Summary

Initializes a new PointerEvent created by the createEvent method.

Method of dom/PointerEvent

Syntax

 event.initPointerEvent(type, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, offsetX, offsetY, width, height, canBubble, pressure, tiltX, tiltY, pointerId, pointerType, isPrimary, cancelable, view, detail, screenX, screenY, clientX, clientY);

Parameters

type

Data-type: String


The type of the event being created, such as: pointerdown, pointerup, pointercancel, pointermove, pointerover, pointerout, pointerenter, pointerleave, gotpointercapture, lostpointercapture.


canBubble

Data-type: Boolean


Indicates whether the event can bubble. When true, the event should propagate upward. When false, the event does not propagate upward.


cancelable

Data-type: Boolean


Indicates whether the event’s default action can be prevented. When true, the default action can be canceled. When false, the default action cannot be canceled.


view

Data-type: any


The view in which the event is taking place.


detail

Data-type: Number


Specifies some detailed information depending upon the event.


screenX

Data-type: Number


The x-coordinate of the event in screen coordinates relative to the upper left corner of the screen.


screenY

Data-type: Number


The y-coordinate of the event in screen coordinates relative to the upper left corner of the screen.


clientX

Data-type: Number


The x-coordinate of the event in client coordinates relative to the upper-left corner of the document's client area.


clientY

Data-type: Number


The y-coordinate of the event in client coordinates relative to the upper-left corner of the document's client area.


ctrlKey

Data-type: Boolean


Indicates the state of the Ctrl key. When true, the left or right Ctrl key is pressed. If false, neither Ctrl key is pressed.


altKey

Data-type: Boolean


Indicates the state of the Alt key. When true, the left or right Alt key is pressed. If false, neither Alt key is pressed.


shiftKey

Data-type: Boolean


Indicates the state of the Shift key. When true, the left or right Shift key is pressed. If false, neither Shift key is pressed.


metaKey

Data-type: Boolean


Indicates the state of the Meta/Command key. If true, the left or right Meta/Command key is pressed. If false neither Meta/Command key is pressed.


button

Data-type: Number


If the event is caused by a mouse event, this indicates the mouse button that caused the event.


relatedTarget

Data-type: any


A reference to the related element.


offsetX

Data-type: Number


The x-coordinate of the event in the element.


offsetY

Data-type: Number


The y-coordinate of the event in the element.


width

Data-type: Number


The contact width of the pointer point specified by pointerId. Default: 0


height

Data-type: Number


The contact height of the pointer point specified by pointerId. Default: 0


pressure

Data-type: Number


Pen pressure normalized in a range of 0 to 255. Default: 0


tiltX

Data-type: Number


The plane angle between the Y-Z plane and the plane containing the transducer axis and the Y axis. A positive X Tilt is to the right.

This quantity is used in conjunction with Y Tilt to represent the tilt away from normal of a transducer, such as a stylus.

Range: -90 to +90 Default: 0


tiltY

Data-type: Number


Represents the angle between the X-Z and transducer-X planes.

A positive Y Tilt is toward the user.

Range: -90 to +90 Default: 0


pointerId

Data-type: Number


Specifies the unique ID of the contact. Default: 0


pointerType

Data-type: String


Indicates whether the source is touch, pen or mouse. Default: ""


isPrimary

Data-type: Boolean


Indicates whether this is the primary pointer that is used to control the mouse position in a multi-touch scenario. Default: false

Return Value

No return value

Needs Examples: This section should include examples.


Syntax

Related specifications

Specification Status Related Changes
Pointer Events Working Draft 3.1.3

Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic Support ?
?
IE10
?
?

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?


Compatibility notes

Browser Version Note
Internet Explorer 10 The PointerEvent object and associated events are supported with the MS prefix. E.g., MSPointerEvent

See also

External resources

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]