Class: SC.TapGesture


Extends SC.Gesture.

Defined in: tap_gesture.js

Field Summary

Instance Methods

Field Detail

name String
Default value:
"tap"
tapLengthDelay Number

The amount of time in milliseconds between when the first touch starts and the last touch ends that should be considered a short enough time to constitute a tap.

Default value:
250
tapStartDelay Number

The amount of time in milliseconds after the first touch starts at which, if the tap hasn't ended in that time, the tapStart event should trigger.

Because taps may be very short or because movement of the touch may invalidate a tap gesture entirely, you generally won't want to update the state of the view immediately when a touch starts.

Default value:
150
tapWiggle Number

The number of pixels that a touch may move before it will no longer be considered a tap. If any of the touches move more than this amount, the gesture will give up.

Default value:
10
touchUnityDelay Number

The number of milliseconds that touches must start and end together in in order to be considered a tap. If the touches start too far apart in time or end too far apart in time based on this value, the gesture will give up.

Default value:
75

Instance Method Detail

touchAddedToSession(touch, touchesInSession)

The tap gesture only remains interested in a touch session as long as none of the touches have started too long after the first touch (value of touchUnityDelay). Once any touch has started too late, the tap gesture gives up for the entire touch session and won't attempt to re-engage (i.e. even if an extra touch "taps" cleanly in the same touch session, it won't trigger any further tap callbacks).

Parameters:
touch SC.Touch
The touch to be added to the session.
touchesInSession Array
The touches already in the session.
Returns:
Boolean
True as long as the new touch doesn't start too late after the first touch.
See:
SC.Gesture#touchAddedToSession
touchCancelledInSession(touch, touchesInSession)
If a touch cancels, the tap doesn't care and remains interested.
Parameters:
touch SC.Touch
The touch to be removed from the session.
touchesInSession Array
The touches in the session.
Returns:
Boolean
True
See:
SC.Gesture#touchCancelledInSession
touchEndedInSession(touch, touchesInSession)

The tap gesture only remains interested in a touch session as long as none of the touches have ended too long after the first touch ends (value of touchUnityDelay). Once any touch has ended too late, the tap gesture gives up for the entire touch session and won't attempt to re-engage (i.e. even if an extra touch "taps" cleanly in the same touch session, it won't trigger any further tap callbacks).

Parameters:
touch SC.Touch
The touch to be removed from the session.
touchesInSession Array
The touches in the session.
Returns:
Boolean
True if it is the first touch to end or a subsequent touch that ends not too long after the first touch ended.
See:
SC.Gesture#touchEndedInSession
touchesMovedInSession(touchesInSession)

The tap gesture only remains interested in a touch session as long as none of the touches have moved too far (value of tapWiggle). Once any touch has moved too far, the tap gesture gives up for the entire touch session and won't attempt to re-engage (i.e. even if an extra touch "taps" cleanly in the same touch session, it won't trigger any further tap callbacks).

Parameters:
touchesInSession Array
All touches in the session.
Returns:
Boolean
True as long as none of the touches have moved too far to be a clean tap.
See:
SC.Gesture#touchesMovedInSession
touchSessionCancelled()
Cleans up all touch session variables.
Returns:
void
See:
SC.Gesture#touchSessionCancelled
touchSessionEnded()
Cleans up all touch session variables and triggers the gesture.
Returns:
void
See:
SC.Gesture#touchSessionEnded
touchSessionStarted(touch)
Registers when the first touch started.
Parameters:
touch SC.Touch
The touch that started the session.
Returns:
void
See:
SC.Gesture#touchSessionStarted
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 08 2015 10:02:21 GMT-0600 (CST)