Input

westures-core. Input

Tracks a single input and contains information about the current, previous, and initial events.

Constructor

new Input(event, identifier)

Source:
Parameters:
Name Type Description
event PointerEvent | MouseEvent | TouchEvent The input event which will initialize this Input object.
identifier number The identifier for this input, so that it can be located in subsequent Event objects.

Members

current :westures-core.PointerData

Description:
  • Holds the most current pointer data for this Input.
Source:
Holds the most current pointer data for this Input.
Type:

elapsedTime :number

Description:
  • The amount of time elapsed between the start of this input and its latest event.
Source:
The amount of time elapsed between the start of this input and its latest event.
Type:
  • number

identifier :number

Description:
  • The identifier for the pointer / touch / mouse button associated with this input.
Source:
The identifier for the pointer / touch / mouse button associated with this input.
Type:
  • number

initial :westures-core.PointerData

Description:
  • Holds the initial data from the mousedown / touchstart / pointerdown that began this input.
Source:
Holds the initial data from the mousedown / touchstart / pointerdown that began this input.
Type:

phase :string

Description:
  • The phase of the input: 'start' or 'move' or 'end' or 'cancel'
Source:
The phase of the input: 'start' or 'move' or 'end' or 'cancel'
Type:
  • string

previous :westures-core.PointerData

Description:
  • Holds the previous pointer data for this Input.
Source:
Holds the previous pointer data for this Input.
Type:

startTime :number

Description:
  • The timestamp of the initiating event for this input.
Source:
The timestamp of the initiating event for this input.
Type:
  • number

Methods

totalDistance() → {number}

Source:
Returns:
The distance between the initiating event for this input and its current event.
Type
number

update(event)

Description:
  • Saves the given raw event in PointerData form as the current data for this input, pushing the old current data into the previous slot, and tossing out the old previous data.
Source:
Parameters:
Name Type Description
event Event The event object to wrap with a PointerData.