Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventTouch

The touch event.

Hierarchy

Index

Constructors

constructor

  • newEventTouch(changedTouches?: Touch[], bubbles?: undefined | false | true, eventCode?: undefined | number, touches?: Touch[]): EventTouch

Properties

Private _allTouches

_allTouches: Touch[]

Private _eventCode

_eventCode: number

Private _touches

_touches: Touch[]

bubbles

bubbles: boolean

Indicate whether the event bubbles up through the hierarchy or not.

currentTarget

currentTarget: Object | null = null

A reference to the currently registered target for the event.

eventPhase

eventPhase: number = 0

Indicates which phase of the event flow is currently being evaluated. Returns an integer value represented by 4 constants:

  • Event.NONE = 0
  • Event.CAPTURING_PHASE = 1
  • Event.AT_TARGET = 2
  • Event.BUBBLING_PHASE = 3 The phases are explained in the [section 3.1, Event dispatch and DOM event flow] markdown, of the DOM Level 3 Events specification.

propagationImmediateStopped

propagationImmediateStopped: boolean = false

Stops propagation for current event immediately, the event won't even be dispatched to the listeners attached in the current target.

propagationStopped

propagationStopped: boolean = false

Stops propagation for current event.

simulate

simulate: boolean = false

Indicate whether the touch event is simulated or real

target

target: Object | null = null

A reference to the target to which the event was originally dispatched.

touch

touch: Touch | null = null

The current touch object

type

type: string

The name of the event (case-sensitive), e.g. "click", "fire", or "submit".

Static ACCELERATION

ACCELERATION: string = "acceleration"

The type code of Acceleration event.

Static AT_TARGET

AT_TARGET: number = 2

The target phase comprises only the event target node [markdown] (http://www.w3.org/TR/DOM-Level-3-Events/#event-flow)

Static BEGAN

BEGAN: number = 0

The event type code of touch began event.

Static BUBBLING_PHASE

BUBBLING_PHASE: number = 3

The bubbling phase comprises any subsequent nodes encountered on the return trip to the root of the hierarchy [markdown] (http://www.w3.org/TR/DOM-Level-3-Events/#event-flow)

Static CANCELLED

CANCELLED: number = 3

The event type code of touch canceled event.

Static CAPTURING_PHASE

CAPTURING_PHASE: number = 1

The capturing phase comprises the journey from the root to the last node before the event target's node markdown

Static ENDED

ENDED: number = 2

The event type code of touch ended event.

Static KEYBOARD

KEYBOARD: string = "keyboard"

The type code of Keyboard event.

Static MAX_TOUCHES

MAX_TOUCHES: number = 5

The maximum touch point numbers simultaneously

Static MOUSE

MOUSE: string = "mouse"

The type code of Mouse event.

Static MOVED

MOVED: number = 1

The event type code of touch moved event.

Static NONE

NONE: number = 0

Events not currently dispatched are in this phase.

Static NO_TYPE

NO_TYPE: string = "no_type"

Code for event without type.

Static TOUCH

TOUCH: string = "touch"

The type code of Touch event.

Methods

getAllTouches

  • getAllTouches(): Touch[]

getCurrentTarget

  • getCurrentTarget(): null | Object
  • Gets current target of the event
    note: It only be available when the event listener is associated with node.
    It returns 0 when the listener is associated with fixed priority.

    Returns null | Object

    • The target with which the event associates.

getDelta

getDeltaX

  • getDeltaX(): number

getDeltaY

  • getDeltaY(): number

getEventCode

  • getEventCode(): number

getID

  • getID(): null | number

getLocation

getLocationInView

getLocationX

  • getLocationX(): number

getLocationY

  • getLocationY(): number

getPreviousLocation

getStartLocation

getTouches

getType

  • getType(): string

getUIDelta

getUILocation

getUIStartLocation

isStopped

  • isStopped(): boolean

reuse

  • reuse(type: string, bubbles?: undefined | false | true): void
  • Reinitialize the event for being used again after retrieved from the object pool.

    Parameters

    • type: string

      The name of the event (case-sensitive), e.g. "click", "fire", or "submit"

    • Optional bubbles: undefined | false | true

      A boolean indicating whether the event bubbles up through the tree or not

    Returns void

setLocation

  • setLocation(x: number, y: number): void

unuse

  • unuse(): void

Generated using TypeDoc