 
 	constructor: ->
 		@em = new DOMEventManager()
-		@em.wrap(window).addEventListener("touchstart", @touchstart)
+		@em.wrap(window).addEventListener(TouchStart, @touchstart)
 
 	destroy: ->
 		@em.removeAllListeners()

	touchend: (event) =>
		# Only fire if there are no fingers left on the screen

		if Utils.isTouch()
			return unless (event.touches.length == 0)
		else
			return unless (event.touches.length == event.changedTouches.length)

		@em.wrap(window).removeEventListener("touchmove", @touchmove)
		@em.wrap(window).removeEventListener("touchend", @touchend)
		@em.wrap(window).removeEventListener("webkitmouseforcechanged", @_updateMacForce)

		event = @_getGestureEvent(event)


{DOMEventManager} = require "./DOMEventManager"

TouchStart = "touchstart"
TouchMove = "touchmove"
TouchEnd = "touchend"

if not Utils.isTouch()
	TouchStart = "mousedown"
	TouchMove = "mousemove"
	TouchEnd = "mouseup"

Utils.sanitizeRotation = ->
	previous = null
