LeapKeyTapGestureΒΆ

Properties:

Methods:

class LeapKeyTapGesture

The LeapKeyTapGesture class represents a tapping gesture by a finger or tool.

Public Functions


- (BOOL) equals:(const LeapGesture *) other

Compare LeapGesture object equality.

[thisGesture equals:thatGesture];

Parameters

Property


- (LeapVector *) direction
direction

The direction of finger tip motion.

LeapVector *tapDirection = keyTap.direction;

Return
LeapVector A unit direction vector.


- (int64_t) duration
duration

The 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.


- (float) durationSeconds
durationSeconds

The elapsed duration in seconds.

float seconds = gesture.duration;

See
duration
Return
float the elapsed duration in seconds.


- (LeapFrame *) frame
frame

The LeapFrame containing this LeapGesture instance.

LeapFrame *owningFrame = gesture.frame;

Return
The parent LeapFrame object.


- (NSArray *) hands
hands

The 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.


- (int32_t) id
id

The gesture ID.

int gestureID = gesture.id;

Return
int32_t the ID of this LeapGesture.


- (BOOL) isValid
isValid

Reports 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.


- (LeapPointable *) pointable
pointable

The finger performing the key tap gesture.

LeapPointable * tapper = keyTap.pointable;

Return
A LeapPointable object representing the tapping finger.


- (NSArray *) pointables
pointables

The 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.


- (LeapVector *) position
position

The position where the key tap is registered.

LeapVector *tapPosition = keyTap.position;

Return
A LeapVector containing the coordinates of key tap location.


- (float) progress
progress

The progess value is always 1.0 for a key tap gesture.

Return
float The value 1.0.


- (LeapGestureState) state
state

The gesture state.

Return
LeapGestureState A value from the LeapGestureState enumeration.


- (LeapGestureType) type
type

The gesture type.

LeapGestureType type = gesture.type;

Return
LeapGestureType A value from the LeapGestureType enumeration.

Public Static Functions


+ (LeapGesture *) invalid

Returns an invalid LeapGesture object.

LeapGesture *wrongGesture = LeapGesture.invalid;

Return
The invalid LeapGesture instance.