Class TouchEvent<H extends EventHandler>

Type Parameters:
H - handler type
All Implemented Interfaces:
HasNativeEvent
Direct Known Subclasses:
TouchCancelEvent, TouchEndEvent, TouchMoveEvent, TouchStartEvent

public abstract class TouchEvent<H extends EventHandler> extends HumanInputEvent<H>
Abstract class representing touch events. See
invalid @link
{@link <a href="http://developer.apple.com/library/safari/documentation/UserExperience/Reference/TouchEventClassReference/TouchEvent/TouchEvent.html">Safari
Touch Event Documentation}
  • Constructor Details

    • TouchEvent

      public TouchEvent()
  • Method Details

    • isSupported

      public static boolean isSupported()
      Runtime check for whether touch scrolling is supported in this browser. Returns true if touch events are supported but touch based scrolling is not natively supported.
      Returns:
      true if touch events are supported, false if not
    • getChangedTouches

      public JsArray<Touch> getChangedTouches()
      Get an array of touches which have changed since the last touch event fired. Note, that for touch end events, the touch which has just ended will not be present in the array. Moreover, if the touch which just ended was the last remaining touch, then a zero length array will be returned.
      Returns:
      an array of touches
    • getTargetTouches

      public JsArray<Touch> getTargetTouches()
      Get an array of touches all touch which originated at the same target as the current touch event. Note, that for touch end events, the touch which has just ended will not be present in the array. Moreover, if the touch which just ended was the last remaining touch, then a zero length array will be returned.
      Returns:
      an array of touches
    • getTouches

      public JsArray<Touch> getTouches()
      Get an array of all current touches. Note, that for touch end events, the touch which has just ended will not be present in the array. Moreover, if the touch which just ended was the last remaining touch, then a zero length array will be returned.
      Returns:
      an array of touches