The PointerEvent() constructor creates a new synthetic and untrusted PointerEvent object instance.
new PointerEvent(type)
new PointerEvent(type, options)typeA string representing the name of the event (see PointerEvent event types).
options OptionalAn object that, in addition of the properties defined in MouseEvent(), can have the following properties:
pointerIdA number, defaulting to 0, that sets the value of the instance's PointerEvent.pointerId.
widthA number, defaulting to 1, that sets the value of the instance's PointerEvent.width.
heightA number, defaulting to 1, that sets the value of the instance's PointerEvent.height.
pressureA number, defaulting to 0, that sets the value of the instance's PointerEvent.pressure.
tangentialPressureA number, defaulting to 0, that sets the value of the instance's PointerEvent.tangentialPressure.
altitudeAngleA number that sets the value of the instance's PointerEvent.altitudeAngle.
azimuthAngleA number that sets the value of the instance's PointerEvent.azimuthAngle.
tiltXA number that sets the value of the instance's PointerEvent.tiltX.
tiltYA number that sets the value of the instance's PointerEvent.tiltY.
twistA number, defaulting to 0, that sets the value of the instance's PointerEvent.twist.
pointerTypeA string, defaulting to "" that sets the value of the instance's PointerEvent.pointerType.
isPrimaryA boolean value, defaulting to false that sets the value of the instance's PointerEvent.isPrimary.
A new PointerEvent object.
const moveEvent = new PointerEvent("pointermove");
const downEvent = new PointerEvent("pointerdown", {
pointerId: 1,
bubbles: true,
cancelable: true,
pointerType: "touch",
width: 100,
height: 100,
isPrimary: true,
});