Safari Developer Library

Developer

GestureEvent Class Reference

Options
Deployment Target:

On This Page

GestureEvent

The GestureEvent class encapsulates information about a multi-touch gesture. More...

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in iOS 2.0 and later.
  • altKey Property

    A Boolean value indicating whether the alt key is pressed.

    Declaration

    JavaScript

    readonly attribute boolean altKey

    Discussion

    If true, the alt key is pressed; otherwise, it is not. If there is no keyboard, this value is false.

    Availability

    Available in iOS 2.0 and later.

  • ctrlKey Property

    A Boolean value indicating whether the control key is pressed.

    Declaration

    JavaScript

    readonly attribute boolean ctrlKey

    Discussion

    If true, the control key is pressed; otherwise, it is not. If there is no keyboard, this value is false.

    Availability

    Available in iOS 2.0 and later.

  • metaKey Property

    A Boolean value indicating whether the meta key is pressed.

    Declaration

    JavaScript

    readonly attribute boolean metaKey

    Discussion

    If true, the meta key is pressed; otherwise, it is not. If there is no keyboard, this value is false.

    Availability

    Available in iOS 2.0 and later.

  • rotation Property

    The delta rotation since the start of an event, in degrees, where clockwise is positive and counter-clockwise is negative.

    Declaration

    JavaScript

    readonly attribute float rotation

    Discussion

    The initial value is 0.0.

    Availability

    Available in iOS 2.0 and later.

  • scale Property

    The distance between two fingers since the start of an event, as a multiplier of the initial distance.

    Declaration

    JavaScript

    readonly attribute float scale

    Discussion

    The initial value is 1.0. If less than 1.0, the gesture is pinch close (to zoom out). If greater than 1.0, the gesture is pinch open (to zoom in).

    Availability

    Available in iOS 2.0 and later.

  • shiftKey Property

    A Boolean value indicating whether the shift key is pressed.

    Declaration

    JavaScript

    readonly attribute boolean shiftKey

    Discussion

    If true, the Shift key is pressed; otherwise, it is not. If there is no keyboard, this value is false.

    Availability

    Available in iOS 2.0 and later.

  • target Property

    The target of this gesture.

    Declaration

    JavaScript

    readonly attribute EventTarget target

    Availability

    Available in iOS 2.0 and later.

  • Initializes a newly created GestureEvent object.

    Declaration

    JavaScript

    void initGestureEvent (in DOMString type, in boolean canBubble, in boolean cancelable, in DOMWindow view, in long detail, in long screenX, in long screenY, in long clientX, in long clientY, in boolean ctrlKey, in boolean altKey, in boolean shiftKey, in boolean metaKey, in EventTarget target, in float scale, in float rotation);

    Parameters

    type

    The type of event that occurred.

    canBubble

    Indicates whether an event can bubble. If true, the event can bubble; otherwise, it cannot.

    cancelable

    Indicates whether an event can have its default action prevented. If true, the default action can be prevented; otherwise, it cannot.

    view

    The view (DOM window) where the event occurred.

    detail

    Specifies some detail information about the event depending on the type of event.

    screenX

    The x-coordinate of the event’s location in screen coordinates.

    screenY

    The y-coordinate of the event’s location in screen coordinates.

    clientX

    The x-coordinate of the event’s location relative to the window's viewport.

    clientY

    The y-coordinate of the event’s location relative to the window's viewport.

    ctrlKey

    If true, the control key is pressed; otherwise, it is not.

    altKey

    If true, the alt key is pressed; otherwise, it is not.

    shiftKey

    If true, the Shift key is pressed; otherwise, it is not.

    metaKey

    If true, the meta key is pressed; otherwise, it is not.

    target

    The target of this gesture.

    scale

    The distance between two fingers since the start of an event as a multiplier of the initial distance. The initial value is 1.0. If less than 1.0, the gesture is pinch close (to zoom out). If greater than 1.0, the gesture is pinch open (to zoom in).

    rotation

    The delta rotation since the start of an event, in degrees, where clockwise is positive and counter-clockwise is negative. The initial value is 0.0.

    Discussion

    Use this method to programmatically create a GestureEvent object.

    Availability

    Available in iOS 2.0 and later.