Class: Touch

Guacamole.Touch(elementnon-null)

new Touch(elementnon-null)

Provides cross-browser multi-touch events for a given element. The events of the given element are automatically populated with handlers that translate touch events into a non-browser-specific event provided by the Guacamole.Touch instance.
Parameters:
Name Type Description
element Element The Element to use to provide touch events.
Source:

Extends

Classes

Event
State

Members

activeTouches

The number of active touches currently stored within touches.
Source:

(non-null) touches :Object.<Number, Guacamole.Touch.State>

The set of all active touches, stored by their unique identifiers.
Type:
Source:

Methods

dispatch(eventnon-null)

Dispatches the given event, invoking all event handlers registered with this Guacamole.Event.Target for that event's type.
Parameters:
Name Type Description
event Guacamole.Event The event to dispatch.
Inherited From:
Source:

off(typenon-null, listenernon-null) → (non-null) {boolean}

Unregisters a listener that was previously registered with on() or onEach(). If no such listener was registered, this function has no effect. If multiple copies of the same listener were registered, the first listener still registered will be removed.
Parameters:
Name Type Description
type string The unique name of the event type handled by the listener being removed.
listener Guacamole.Event.Target~listener The listener function previously provided to on()or onEach().
Inherited From:
Source:
Returns:
true if the specified listener was removed, false otherwise.
Type
boolean

offEach(typesnon-null, listenernon-null) → (non-null) {boolean}

Unregisters listeners that were previously registered with on() or onEach(). If no such listeners were registered, this function has no effect. If multiple copies of the same listener were registered for the same event type, the first listener still registered will be removed.

Invoking this function is equivalent to manually invoking off() for each of the provided types.

Parameters:
Name Type Description
types Array.<string> The unique names of the event types handled by the listeners being removed.
listener Guacamole.Event.Target~listener The listener function previously provided to on() or onEach().
Inherited From:
Source:
Returns:
true if any of the specified listeners were removed, false otherwise.
Type
boolean

on(typenon-null, listenernon-null)

Registers a listener for events having the given type, as dictated by the type property of Guacamole.Event provided to dispatch().
Parameters:
Name Type Description
type string The unique name of this event type.
listener Guacamole.Event.Target~listener The function to invoke when an event having the given type is dispatched. The Guacamole.Event object provided to dispatch() will be passed to this function, along with the dispatching Guacamole.Event.Target.
Inherited From:
Source:

onEach(typesnon-null, listenernon-null)

Registers a listener for events having the given types, as dictated by the type property of Guacamole.Event provided to dispatch().

Invoking this function is equivalent to manually invoking on() for each of the provided types.

Parameters:
Name Type Description
types Array.<string> The unique names of the event types to associate with the given listener.
listener Guacamole.Event.Target~listener The function to invoke when an event having any of the given types is dispatched. The Guacamole.Event object provided to dispatch() will be passed to this function, along with the dispatching Guacamole.Event.Target.
Inherited From:
Source:

Events

touchend

Fired whenever an established touch contact is lifted from the element associated with this Guacamole.Touch.
Parameters:
Name Type Description
event Guacamole.Touch.Event A Guacamole.Touch.Event object representing the "touchend" event.
Source:

touchmove

Fired whenever an established touch contact moves within the element associated with this Guacamole.Touch.
Parameters:
Name Type Description
event Guacamole.Touch.Event A Guacamole.Touch.Event object representing the "touchmove" event.
Source:

touchstart

Fired whenever a new touch contact is initiated on the element associated with this Guacamole.Touch.
Parameters:
Name Type Description
event Guacamole.Touch.Event A Guacamole.Touch.Event object representing the "touchstart" event.
Source: