Class TouchEventInit


  • public final class TouchEventInit
    extends EventInit
    Initialization object for a NativeTouchEvent.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • TouchEventInit

        public TouchEventInit()
        Creates an empty object
      • TouchEventInit

        public TouchEventInit​(Touch... touches)
        Creates an object with an array of objects for every point of contact currently touching the surface.
        Parameters:
        touches - an array of objects for every point of contact currently touching the surface
      • TouchEventInit

        public TouchEventInit​(List<Touch> touches)
        Creates an object with an array of objects for every point of contact currently touching the surface.
        Parameters:
        touches - an array of objects for every point of contact currently touching the surface
    • Method Detail

      • getModifiersHandler

        public org.pepstock.charba.client.dom.events.ModifiersHandler getModifiersHandler()
      • setChangedTouches

        public void setChangedTouches​(Touch... touches)
        Sets an array of objects for every point of contact which contributed to the event.
        Parameters:
        touches - an array of objects for every point of contact which contributed to the event
      • setChangedTouches

        public void setChangedTouches​(List<Touch> touches)
        Sets a list of objects for every point of contact which contributed to the event.
        Parameters:
        touches - a list of objects for every point of contact which contributed to the event
      • getChangedTouches

        public List<Touch> getChangedTouches()
        Returns a list of objects for every point of contact which contributed to the event.
        Returns:
        a list of objects for every point of contact which contributed to the event.
      • setTargetTouches

        public void setTargetTouches​(Touch... touches)
        Sets an array of objects for every point of contact that is touching the surface and started on the element that is the target of the current event.
        Parameters:
        touches - an array of objects for every point of contact that is touching the surface and started on the element that is the target of the current event
      • setTargetTouches

        public void setTargetTouches​(List<Touch> touches)
        Sets a list of objects for every point of contact that is touching the surface and started on the element that is the target of the current event
        Parameters:
        touches - a list of objects for every point of contact that is touching the surface and started on the element that is the target of the current event
      • getTargetTouches

        public List<Touch> getTargetTouches()
        Returns a list of objects for every point of contact that is touching the surface and started on the element that is the target of the current event.
        Returns:
        a list of objects for every point of contact that is touching the surface and started on the element that is the target of the current event
      • setTouches

        public void setTouches​(Touch... touches)
        Sets an array of objects for every point of contact currently touching the surface.
        Parameters:
        touches - an array of objects for every point of contact currently touching the surface
      • setTouches

        public void setTouches​(List<Touch> touches)
        Sets an array of objects for every point of contact currently touching the surface.
        Parameters:
        touches - an array of objects for every point of contact currently touching the surface
      • getTouches

        public List<Touch> getTouches()
        Returns a list of objects for every point of contact currently touching the surface.
        Returns:
        a list of objects for every point of contact currently touching the surface.
      • 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