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


class com::leapmotion::leap::KeyTapGesture

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

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

Public Functions

Vector direction()

The direction of finger tip motion.

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(Gesture rhs)

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

if(gesture.type() == KeyTapGesture.classType()) {
    KeyTapGesture keytapGesture = new KeyTapGesture(gesture);

Pointable pointable()

The finger performing the key tap gesture.

Pointable tappingPointable = keytap.pointable();

Pointable A Pointable object representing the tapping finger.

Vector position()

The position where the key tap is registered.

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

Gesture.Type classType()

The key tap gesture type.

if(gesture.type() == KeyTapGesture.classType()) {
    KeyTapGesture keytapGesture = new KeyTapGesture(gesture);

Type The type value designating a key tap gesture.