Class PointerEventInit

    • Constructor Detail

      • PointerEventInit

        public PointerEventInit()
        Creates an empty object
      • PointerEventInit

        public PointerEventInit​(int id)
        Creates an object setting the pointer id by the passed argument.
        Parameters:
        id - pointer id to set.
      • PointerEventInit

        public PointerEventInit​(int id,
                                PointerType type)
        Creates an initialization object, setting the pointer id and the pointer type values.
        Parameters:
        id - pointer id to set.
        type - pointer type initialization property.
      • PointerEventInit

        public PointerEventInit​(NativePointerEvent source)
        Creates an initialization object, cloning all source event data
        Parameters:
        source - source event to clone.
      • PointerEventInit

        public PointerEventInit​(NativePointerEvent source,
                                BaseHtmlElement relatedTarget)
        Creates an initialization object, cloning all source event data and new related target.
        Parameters:
        source - source event to clone.
        relatedTarget - new target of the event
    • Method Detail

      • getId

        public final int getId()
        Returns a unique identifier for the pointer causing the event.
        Returns:
        a unique identifier for the pointer causing the event
      • setId

        public final void setId​(int id)
        Sets a unique identifier for the pointer causing the event.
        Parameters:
        id - a unique identifier for the pointer causing the event
      • getWidth

        public final 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
      • setWidth

        public final void setWidth​(double width)
        Sets the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer.
        Parameters:
        width - the width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer
      • getHeight

        public final 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.
      • setHeight

        public final void setHeight​(double height)
        Sets the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
        Parameters:
        height - the height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
      • getPressure

        public final 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.
      • setPressure

        public final void setPressure​(double pressure)
        Sets 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.
        Parameters:
        pressure - 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

        public final 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.
      • setTiltX

        public final void setTiltX​(double tiltx)
        Sets 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.
        Parameters:
        tiltx - 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

        public final 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.
      • setTiltY

        public final void setTiltY​(double tilty)
        Sets 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.
        Parameters:
        tilty - 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.
      • getPointerType

        public final 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.)
      • setPointerType

        public final void setPointerType​(PointerType pointerType)
        Sets the device type that caused the event (mouse, pen, touch, etc.).
        Parameters:
        pointerType - the device type that caused the event (mouse, pen, touch, etc.)
      • isPrimary

        public final 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
      • setPrimary

        public final void setPrimary​(boolean isPrimary)
        Sets true if the pointer represents the primary pointer of this pointer type.
        Parameters:
        isPrimary - true if the pointer represents the primary pointer of this pointer type
      • isAltKey

        public default boolean isAltKey()
        Returns true if the alt key was down when the mouse event was fired.
        Returns:
        true if the alt key was down when the mouse event was fired
      • setAltKey

        public default void setAltKey​(boolean alt)
        Sets true if the alt key was down when the mouse event was fired.
        Parameters:
        alt - true if the alt key was down when the mouse event was fired
      • isCtrlKey

        public default boolean isCtrlKey()
        Returns true if the control key was down when the mouse event was fired.
        Returns:
        true if the control key was down when the mouse event was fired
      • setCtrlKey

        public default void setCtrlKey​(boolean ctrl)
        Sets true if the control key was down when the mouse event was fired.
        Parameters:
        ctrl - true if the control key was down when the mouse event was fired
      • isMetaKey

        public default boolean isMetaKey()
        Returns true if the meta key was down when the mouse event was fired.
        Returns:
        true if the meta key was down when the mouse event was fired
      • setMetaKey

        public default void setMetaKey​(boolean meta)
        Sets true if the meta key was down when the mouse event was fired.
        Parameters:
        meta - true if the meta key was down when the mouse event was fired
      • isShiftKey

        public default boolean isShiftKey()
        Returns true if the shift key was down when the mouse event was fired.
        Returns:
        true if the shift key was down when the mouse event was fired
      • setShiftKey

        public default void setShiftKey​(boolean shift)
        Sets true if the shift key was down when the mouse event was fired.
        Parameters:
        shift - true if the shift key was down when the mouse event was fired
      • getDetail

        public final int getDetail()
        When non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero.
        Returns:
        When non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero
      • setDetail

        public final void setDetail​(int detail)
        Sets non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero
        Parameters:
        detail - non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero