processing-js/processing-js — pull request #118 by uofajillian (2014-10-16 01:18:16+00:00)
Title: Issue #99 : withTouch() touchstart event was relying on direct access to...

Issue #99 : the withTouch() touchstart event handler was relying on direct access to the Processing.eventHandlers array to remove any existing mouse event handlers.

Instead of exposing Processing.eventHandlers array directly, this change exposes a method called detachEventHandlersByTypeMatch() which takes a regex of event types, iterates through the list of existing event handlers, and detaches the handlers that match.

The withTouch() touchstart handler then calls detachEventHandlersByTypeMatch() with a regex that matches the desired mouse events.