Skip to content

@ue-too/board / index / TouchContext

介面: TouchContext

定義於: packages/board/src/input-interpretation/input-state-machine/touch-input-context.ts:47

Context interface for the touch input state machine.

備註

This context manages the state required for multi-touch gesture recognition:

Touch Point Tracking:

  • Maintains a map of active touch points by identifier
  • Stores initial positions to calculate deltas for pan gestures
  • Stores initial distances to calculate zoom factors

Gesture Recognition:

  • Single-finger: Not handled (reserved for UI interactions)
  • Two-finger: Pan and pinch-to-zoom gestures
  • Three+ fingers: Currently not handled

Coordinate System: Similar to KMT, the alignCoordinateSystem flag controls Y-axis orientation.

This interface extends BaseContext from the @ue-too/being state machine library.

Extends

  • BaseContext

屬性

addTouchPoints()

addTouchPoints: (points) => void

定義於: packages/board/src/input-interpretation/input-state-machine/touch-input-context.ts:49

Adds new touch points to tracking

參數

points

TouchPoints[]

回傳

void


alignCoordinateSystem

alignCoordinateSystem: boolean

定義於: packages/board/src/input-interpretation/input-state-machine/touch-input-context.ts:59

Whether to use standard screen coordinate system (vs inverted Y-axis)


canvas

canvas: Canvas

定義於: packages/board/src/input-interpretation/input-state-machine/touch-input-context.ts:61

Canvas accessor for dimensions and coordinate transformations


getCurrentTouchPointsCount()

getCurrentTouchPointsCount: () => number

定義於: packages/board/src/input-interpretation/input-state-machine/touch-input-context.ts:53

Returns the current number of active touch points

回傳

number


getInitialTouchPointsPositions()

getInitialTouchPointsPositions: (idents) => TouchPoints[]

定義於: packages/board/src/input-interpretation/input-state-machine/touch-input-context.ts:55

Retrieves the initial positions of specific touch points

參數

idents

number[]

回傳

TouchPoints[]


removeTouchPoints()

removeTouchPoints: (idents) => void

定義於: packages/board/src/input-interpretation/input-state-machine/touch-input-context.ts:51

Removes touch points from tracking by identifier

參數

idents

number[]

回傳

void


updateTouchPoints()

updateTouchPoints: (pointsMoved) => void

定義於: packages/board/src/input-interpretation/input-state-machine/touch-input-context.ts:57

Updates the current positions of touch points

參數

pointsMoved

TouchPoints[]

回傳

void

方法

cleanup()

cleanup(): void

定義於: packages/being/dist/interface.d.ts:31

回傳

void

繼承自

BaseContext.cleanup


setup()

setup(): void

定義於: packages/being/dist/interface.d.ts:30

回傳

void

繼承自

BaseContext.setup