WanaPlan

API Docs for: 2.7.0
Show:

wnp.Input.TouchManager

Module: Input
Parent Module: Wanaplan

Summary

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

Syntax

wnp.Input.TouchManager

(
  • domElement
)

Summary

Parameters:

Item Index

Methods

off

Syntax

off

(
  • eventName
)

Summary

Detaches an event listener from an event type.

Parameters:

  • eventName String

    The listened event name.

on

Syntax

on

(
  • eventName
  • callback
)

Summary

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

Syntax

setDeadZone

(
  • deadZone
)

Summary

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

Syntax

start

()

Summary

Starts the manager activity.

stop

Syntax

stop

()

Summary

Stops the manager activity.