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.

Extends

  • GridPosition

Properties

PropertyTypeDescriptionInherited from
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-
xnumberThe X coordinate (column), often relative to the grid's center.GridPosition.x
ynumberThe Y coordinate (row), often relative to the grid's center.GridPosition.y