Skip to content

textmode.js / input / touch / TouchPosition

Interface: TouchPosition

Touch position expressed both in grid and client coordinates.

The grid coordinate system uses center-based coordinates matching the rendering space:

  • (0, 0) is the center cell of the grid
  • Negative X values are to the left of center
  • Positive X values are to the right of center
  • Negative Y values are above center
  • Positive Y values are below center

When the touch is outside the grid bounds, x and y are set to Number.NEGATIVE_INFINITY to indicate an invalid/outside position.

Properties

PropertyTypeDescription
clientXnumberClient X coordinate in CSS pixels
clientYnumberClient Y coordinate in CSS pixels
idnumberIdentifier provided by the browser for a touch point
pressure?numberTouch pressure (0-1) when supported
radiusX?numberContact ellipse radius on the X axis in CSS pixels
radiusY?numberContact ellipse radius on the Y axis in CSS pixels
rotationAngle?numberContact ellipse angle in radians when provided
xnumberGrid X coordinate (column) in center-based coords. Number.NEGATIVE_INFINITY if outside grid.
ynumberGrid Y coordinate (row) in center-based coords. Number.NEGATIVE_INFINITY if outside grid.