Interface Touch

All Superinterfaces:
org.teavm.jso.JSObject

public interface Touch extends org.teavm.jso.JSObject

The Touch interface represents a single contact point on a touch-sensitive device. The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad.

The getRadiusX(), getRadiusY(), and getRotationAngle() describe the area of contact between the user and the screen, the touch area. This can be helpful when dealing with imprecise pointing devices such as fingers. These values are set to describe an ellipse that as closely as possible matches the entire area of contact (such as the user's fingertip).

  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the X coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset.
    double
    Returns the Y coordinate of the touch point relative to the top edge of the browser viewport, not including any scroll offset.
    double
    Returns the amount of pressure being applied to the surface by the user, as a float between 0.0 (no pressure) and 1.0 (maximum pressure).
    int
    Returns a unique identifier for this Touch object.
    double
    Returns the X coordinate of the touch point relative to the left edge of the document.
    double
    Returns the Y coordinate of the touch point relative to the top of the document.
    double
    Returns the X radius of the ellipse that most closely circumscribes the area of contact with the screen.
    double
    Returns the Y radius of the ellipse that most closely circumscribes the area of contact with the screen.
    double
    Returns the angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated, clockwise, to most accurately cover the area of contact between the user and the surface.
    double
    Returns the X coordinate of the touch point relative to the left edge of the screen.
    double
    Returns the Y coordinate of the touch point relative to the top edge of the screen.
    Returns the TouchEventTarget on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document.

    Methods inherited from interface org.teavm.jso.JSObject

    cast
  • Method Details

    • getIdentifier

      int getIdentifier()
      Returns a unique identifier for this Touch object. A given touch point (say, by a finger) will have the same identifier for the duration of its movement around the surface. This lets you ensure that you're tracking the same touch all the time.
    • getScreenX

      double getScreenX()
      Returns the X coordinate of the touch point relative to the left edge of the screen.
    • getScreenY

      double getScreenY()
      Returns the Y coordinate of the touch point relative to the top edge of the screen.
    • getClientX

      double getClientX()
      Returns the X coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset.
    • getClientY

      double getClientY()
      Returns the Y coordinate of the touch point relative to the top edge of the browser viewport, not including any scroll offset.
    • getPageX

      double getPageX()
      Returns the X coordinate of the touch point relative to the left edge of the document. Unlike clientX, this value includes the horizontal scroll offset, if any.
    • getPageY

      double getPageY()
      Returns the Y coordinate of the touch point relative to the top of the document. Unlike clientY, this value includes the vertical scroll offset, if any.
    • getTarget

      TouchEventTarget getTarget()
      Returns the TouchEventTarget on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document.
    • getRadiusX

      double getRadiusX()
      Returns the X radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as screenX.
    • getRadiusY

      double getRadiusY()
      Returns the Y radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as screenY.
    • getRotationAngle

      double getRotationAngle()
      Returns the angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated, clockwise, to most accurately cover the area of contact between the user and the surface.
    • getForce

      double getForce()
      Returns the amount of pressure being applied to the surface by the user, as a float between 0.0 (no pressure) and 1.0 (maximum pressure).