Notice Gestures are deprecated in version 3.0 and may not behave the same as they did in earlier versions.


class Leap::KeyTapGesture

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

controller.config().setFloat("Gesture.KeyTap.MinDownVelocity", 40.0);
controller.config().setFloat("Gesture.KeyTap.HistorySeconds", .2);
controller.config().setFloat("Gesture.KeyTap.MinDistance", 8.0);

Public Functions

Vector direction()

The direction of finger tip motion.

Leap::Vector tapDirection = keytap.direction();

Vector A unit direction vector if the finger tip is moving; otherwise, a zero-vector.


Constructs a new KeyTapGesture object.

KeyTapGesture(const Gesture & rhs)

Constructs a KeyTapGesture object from an instance of the Gesture class.

 Leap::KeyTapGesture keytapGesture = Leap::Gesture::invalid();
 if(gesture.type() == Leap::KeyTapGesture::classType())
    keytapGesture = Leap::KeyTapGesture(gesture);

Pointable pointable()

The finger performing the key tap gesture.

Leap::Pointable tappingPointable = keytap.pointable();

Pointable A Pointable object representing the tapping finger.

Vector position()

The position where the key tap is registered.

Leap::Vector tapPosition = keytap.position();

Vector A Vector containing the coordinates of tap location.

float progress()

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

float The value 1.0.

Public Static Functions

Type classType()

The key tap gesture type.

if(gesture.type() == Leap::KeyTapGesture::classType())
    Leap::KeyTapGesture keytapGesture = Leap::KeyTapGesture(gesture);

Type The type value designating a key tap gesture.