Gesture class encapsulates information about a multi-touch gesture.
- Safari Desktop 10.1+
- Safari Mobile 2.0+
- WebKit JS
Gesture objects are high-level events that encapsulate the low-level
Touch objects. Both
Touch events are sent during a multi-touch sequence. Gesture events contain scaling and rotation information allowing gestures to be combined, if supported by the platform. If not supported, one gesture ends before another starts. Listen for
Gesture events if you want to respond to gestures only, not process the low-level
The different types of
Gesture objects that can occur are:
Sent when two or more fingers touch the surface.
Sent when fingers are moved during a gesture.
Sent when the gesture ends (when there are 1 or 0 fingers touching the surface).
For example, for a two finger multi-touch gesture, the events occur in the following sequence:
touchstartfor finger 1. Sent when the first finger touches the surface.
gesturestart. Sent when the second finger touches the surface.
touchstartfor finger 2. Sent immediately after
gesturestartwhen the second finger touches the surface.
gesturechangefor current gesture. Sent when both fingers move while still touching the surface.
gestureend. Sent when the second finger lifts from the surface.
touchendfor finger 2. Sent immediately after
gestureendwhen the second finger lifts from the surface.
touchendfor finger 1. Sent when the first finger lifts from the surface.
Touch if you want to process just low-level