API Docs for: 2.7.3
Show:

wnp.Input.TouchManager Class

Module: Input
Parent Module: Wanaplan

Manages touch events on mobile devices. All events are listed below along with their parameters. You can register/unregister your own callbacks using the methods on and off.
N.B : Use event.clientX or event.pageX to get the positions, depending on the browser you target.

Events :

  • touchDown, button : Number
  • touchUp
  • touchMove
  • tap
  • dblTap
  • longPress
  • swipe
  • rotate

Constructor

wnp.Input.TouchManager

(
  • domElement
)

Parameters:

Item Index

Methods

off

(
  • eventName
)

Detaches an event listener from an event type.

Parameters:

  • eventName String

    The listened event name.

on

(
  • eventName
  • callback
)

Attaches an event listener to an event type.

Parameters:

  • eventName String

    The event to listen.

  • callback Function

    The method to call when the event is triggered.

setDeadZone

(
  • deadZone
)

Sets the dead zone value. This value is used when a finger is moving on the screen. If the delta position is lesser than dead zone then the move event is not triggered.

Parameters:

  • deadZone Number

    The value of the dead zone. Default is 2.0.

start

()

Starts the manager activity.

stop

()

Stops the manager activity.