Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 3.13 KB

touch.rst

File metadata and controls

87 lines (61 loc) · 3.13 KB

dojo/touch

Project owner

Evan Huang

since

v1.7

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.

Usage

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 dojo/on <dojo/on>. For example:

Also, the touch event listeners can be registered directly with the module:

Events

The following table provides information on the events supported by the module:

dojo/touch Event Browser Touch Device Notes

press release over out enter leave

mousedown mouseup mouseover mouseout dojo/mouse::enter <dojo/mouse#enter> dojo/mouse::leave <dojo/mouse#leave>

touchstart touchend synthetic synthetic synthetic synthetic

move

cancel

mousemove

mouseleave

synthetic

touchcancel

This synthetic events fires on the node that the finger is currently over, rather than the node where the drag started.

dojox/gesture

dojox/gesture <dojox/gesture> extends dojo/touch.

Known Issues

If a device has both mouse and touch (like Blackberry phones or some high end desktop computers), dojo/touch will only monitor touch events; ideally it should be monitoring both.

Please see #13048. This will not be addressed until Dojo 2.0.

See Also