Class NativeTouchEvent

  • All Implemented Interfaces:
    IsJSType, IsCastable

    @JsType(isNative=true,
            name="TouchEvent",
            namespace="<global>")
    public final class NativeTouchEvent
    extends NativeUIEvent
    Represents an NativeUIEvent which is sent when the state of contacts with a touch-sensitive surface changes.
    This surface can be a touch screen or trackpad, for example.
    The event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • isAltKey

        @JsProperty
        public boolean isAltKey()
        Returns true if the alt key was down when the touch event was fired.
        Returns:
        true if the alt key was down when the touch event was fired
      • isCtrlKey

        @JsProperty
        public boolean isCtrlKey()
        Returns true if the control key was down when the touch event was fired.
        Returns:
        true if the control key was down when the touch event was fired
      • isMetaKey

        @JsProperty
        public boolean isMetaKey()
        Returns true if the meta key was down when the touch event was fired.
        Returns:
        true if the meta key was down when the touch event was fired
      • isShiftKey

        @JsProperty
        public boolean isShiftKey()
        Returns true if the shift key was down when the touch event was fired.
        Returns:
        true if the shift key was down when the touch event was fired
      • getChangedTouches

        @JsProperty
        public TouchList getChangedTouches()
        Returns a list of all the touch objects representing individual points of contact whose states changed between the previous touch event and this one.
        Returns:
        a list of all the touch objects representing individual points of contact whose states changed between the previous touch event and this one
      • getTargetTouches

        @JsProperty
        public TouchList getTargetTouches()
        Returns a list of all the touch objects that are both currently in contact with the touch surface and were also started on the same element that is the target of the event.
        Returns:
        a list of all the touch objects that are both currently in contact with the touch surface and were also started on the same element that is the target of the event
      • getTouches

        @JsProperty
        public TouchList getTouches()
        Returns a list of all the touch objects representing all current points of contact with the surface, regardless of target or changed status.
        Returns:
        a list of all the touch objects representing all current points of contact with the surface, regardless of target or changed status
      • createTouchEvent

        @JsOverlay
        public static NativeTouchEvent createTouchEvent​(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
      • createTouchEvent

        @JsOverlay
        public static NativeTouchEvent createTouchEvent​(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
      • createTouchEvent

        @JsOverlay
        public static NativeTouchEvent createTouchEvent​(IsEvent type,
                                                        TouchEventInit 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
      • createTouchEvent

        @JsOverlay
        public static NativeTouchEvent createTouchEvent​(String type,
                                                        TouchEventInit 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