|Project owner:||Evan Huang|
dojo/touch is a module that provides a set of events designed to work similarly on a desktop browser (e.g. with mouse) and touch devices, so that the developer only needs to handle code for one set of events and abstract themselves from the specifics of mouse and touch events.
Requiring in the module makes the events available for handling:
There are two main ways of using
dojo/touch. The first is using it coupled with :ref:`dojo/on <dojo/on>`. For example:
Also, the touch event listeners can be registered directly with the module:
The following table provides information on the events supported by the module:
|dojo/touch Event||Browser||Touch Device||Notes|
|move||mousemove||synthetic||This synthetic events fires on the node that the finger is currently over, rather than the node where the drag started.|
:ref:`dojox/gesture <dojox/gesture>` extends
If a device has both mouse and touch (like Blackberry phones or some high end desktop computers),
only monitor touch events; ideally it should be monitoring both.
Please see #13048. This will not be addressed until Dojo 2.0.