 
 	_dispatchEvent: (type, event, target) ->
 		touchEvent = @_createEvent(type, event)
+		# By default we want to send the event to the target at the beginning
+		# of this session, so we catch tap ends etc when the mouse is released
+		# outside of the original target.
+		target ?= @session?.startEvent?.target
 		target ?= event.target
 		target.dispatchEvent(touchEvent)
 

	TouchMove = "mousemove"
	TouchEnd = "mouseup"

Utils.sanitizeRotation = ->
	previous = null
	return sanitize = (value) ->
		previous ?= value
		return value


class exports.GestureInputRecognizer

	constructor: ->

		@_process(@_getGestureEvent(event))

	touchend: (event) =>

		# Only fire if there are no fingers left on the screen

		if event.touches?
