Class NativePointerEvent

  • All Implemented Interfaces:
    IsJSType, IsCastable

    @JsType(isNative=true,
            name="PointerEvent",
            namespace="<global>")
    public final class NativePointerEvent
    extends NativeAbstractMouseEvent
    Much of today's web content assumes the user's pointing device will be a mouse.
    However, since many devices support other types of pointing input devices, such as pen/stylus and touch surfaces, extensions to the existing pointing device event models are needed.
    Pointer events address that need.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • getId

        @JsProperty(name="pointerId")
        public int getId()
        Returns a unique identifier for the pointer causing the event.
        Returns:
        a unique identifier for the pointer causing the event
      • getWidth

        @JsProperty
        public double getWidth()
        Returns the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer.
        Returns:
        the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer
      • getHeight

        @JsProperty
        public double getHeight()
        Returns the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
        Returns:
        the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
      • getPressure

        @JsProperty
        public double getPressure()
        Returns the normalized pressure of the pointer input in the range of 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.
        Returns:
        the normalized pressure of the pointer input in the range of 0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.
      • getTiltX

        @JsProperty
        public double getTiltX()
        Returns the plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane and the plane containing both the pointer (e.g. pen stylus) axis and the Y axis.
        Returns:
        the plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane and the plane containing both the pointer (e.g. pen stylus) axis and the Y axis.
      • getTiltY

        @JsProperty
        public double getTiltY()
        Returns the plane angle (in degrees, in the range of -90 to 90) between the X–Z plane and the plane containing both the pointer (e.g. pen stylus) axis and the X axis.
        Returns:
        the plane angle (in degrees, in the range of -90 to 90) between the X–Z plane and the plane containing both the pointer (e.g. pen stylus) axis and the X axis.
      • isPrimary

        @JsProperty(name="isPrimary")
        public boolean isPrimary()
        Returns true if the pointer represents the primary pointer of this pointer type.
        Returns:
        true if the pointer represents the primary pointer of this pointer type
      • createPointerEvent

        @JsOverlay
        public static NativePointerEvent createPointerEvent​(String type)
        Creates a new event object for a specific event type.
        Parameters:
        type - type of event
        Returns:
        a new event object for a specific event type
      • createPointerEvent

        @JsOverlay
        public static NativePointerEvent createPointerEvent​(IsEvent type)
        Creates a new event object for a specific event type.
        Parameters:
        type - type of event
        Returns:
        a new event object for a specific event type
      • createPointerEvent

        @JsOverlay
        public static NativePointerEvent createPointerEvent​(IsEvent type,
                                                            PointerEventInit init)
        Creates a new event object for a specific event type with initial configuration.
        Parameters:
        type - type of event
        init - initial configuration of the event
        Returns:
        a new event object for a specific event type
      • createPointerEvent

        @JsOverlay
        public static NativePointerEvent createPointerEvent​(String type,
                                                            PointerEventInit init)
        Creates a new event object for a specific event type with initial configuration.
        Parameters:
        type - type of event
        init - initial configuration of the event
        Returns:
        a new event object for a specific event type
      • getPointerType

        @JsOverlay
        public PointerType getPointerType()
        Returns the device type that caused the event (mouse, pen, touch, etc.).
        Returns:
        the device type that caused the event (mouse, pen, touch, etc.)