Properties:
Methods:
The LeapGesture class represents a recognized movement by the user.
Public FunctionsProperty- (BOOL) equals:(const LeapGesture *) otherCompare LeapGesture object equality.
[thisGesture equals:thatGesture];
- Parameters
- other -
The LeapGesture object to compare.
Public Static Functionsduration- (int64_t) durationThe elapsed duration of the recognized movement up to the frame containing this LeapGesture object, in microseconds.
int64_t microseconds = gesture.duration;
- Return
- int64_t the elapsed duration in microseconds.
durationSeconds- (float) durationSecondsThe elapsed duration in seconds.
float seconds = gesture.duration;
- See
- duration
- Return
- float the elapsed duration in seconds.
frame- (LeapFrame *) frameThe LeapFrame containing this LeapGesture instance.
LeapFrame *owningFrame = gesture.frame;
- Return
- The parent LeapFrame object.
hands- (NSArray *) handsThe list of hands associated with this LeapGesture, if any.
NSArray *handList = gesture.hands; //Only one hand for current gestures LeapHand *gesturingHand = [handList objectAtIndex:0];
- Return
- NSArray the list of related LeapHand objects.
id- (int32_t) idisValid- (BOOL) isValidReports whether this LeapGesture instance represents a valid gesture.
LeapFrame *frame = [controller frame:0]; LeapGesture *trackedGesture = [frame gesture:trackedGestureID]; if(trackedGesture.isValid) { //Use the data... }
- Return
- bool Yes, if this is a valid LeapGesture instance; NO, otherwise.
pointables- (NSArray *) pointablesThe list of fingers and tools associated with this LeapGesture, if any.
NSArray *pointableList = gesture.pointables; //Only one pointable for current gestures LeapHand *gesturingPointable = [pointableList objectAtIndex:0];
- Return
- NSArray the list of related LeapPointable objects.
state- (LeapGestureState) stateThe gesture state.
- Return
- LeapGestureState A value from the LeapGestureState enumeration.
type- (LeapGestureType) typeThe gesture type.
LeapGestureType type = gesture.type;
- Return
- LeapGestureType A value from the LeapGestureType enumeration.
+ (LeapGesture *) invalidReturns an invalid LeapGesture object.
LeapGesture *wrongGesture = LeapGesture.invalid;
- Return
- The invalid LeapGesture instance.
LeapGestureType enum
The supported types of gestures.
Values:
- LEAP_GESTURE_TYPE_INVALID = = -1 -
An invalid type.
- LEAP_GESTURE_TYPE_SWIPE = = 1 -
A straight line movement by the hand with fingers extended.
- LEAP_GESTURE_TYPE_CIRCLE = = 4 -
A circular movement by a finger.
- LEAP_GESTURE_TYPE_SCREEN_TAP = = 5 -
A forward tapping movement by a finger.
- LEAP_GESTURE_TYPE_KEY_TAP = = 6 -
A downward tapping movement by a finger.
LeapGestureState enum
The possible gesture states.
Values:
- LEAP_GESTURE_STATE_INVALID = = -1 -
An invalid state.
- LEAP_GESTURE_STATE_START = = 1 -
The gesture is starting.
Just enough has happened to recognize it.
- LEAP_GESTURE_STATE_UPDATE = = 2 -
The gesture is in progress.
(Note: not all gestures have updates).
- LEAP_GESTURE_STATE_STOP = = 3 -
The gesture has completed or stopped.