KeyTapGestureΒΆ
Properties:
Methods:
The KeyTapGesture class represents a tapping gesture by a finger or tool.
A key tap gesture is recognized when the tip of a finger rotates down toward the palm and then springs back to approximately the original position, as if tapping. The tapping finger must pause briefly before beginning the tap.
Important: To use key tap gestures in your application, you must enable recognition of the key tap gesture. You can enable recognition with:
controller.EnableGesture (Gesture.GestureType.TYPE_KEY_TAP);Key tap gestures are discrete. The KeyTapGesture object representing a tap always has the state, STATE_STOP. Only one KeyTapGesture object is created for each key tap gesture recognized.
You can set the minimum finger movement and velocity required for a movement to be recognized as a key tap as well as adjust the detection window for evaluating the movement using the config attribute of a connected Controller object. Use the following configuration keys to configure key tap recognition:
Key string Value type Default value Units Gesture.KeyTap.MinDownVelocity float 50 mm/s Gesture.KeyTap.HistorySeconds float 0.1 s Gesture.KeyTap.MinDistance float 3.0 mm The following example demonstrates how to set the key tap configuration parameters:
controller.Config.SetFloat ("Gesture.KeyTap.MinDownVelocity", 40.0f); controller.Config.SetFloat ("Gesture.KeyTap.HistorySeconds", .2f); controller.Config.SetFloat ("Gesture.KeyTap.MinDistance", 1.0f); controller.Config.Save ();The Controller object must be connected to the Leap Motion service/daemon before setting the configuration parameters.
Public Functions
- Since
- 1.0
PropertyKeyTapGesture()Constructs a new KeyTapGesture object.
An uninitialized KeyTapGesture object is considered invalid. Get valid instances of the KeyTapGesture class from a Frame object.
- Since
- 1.0
KeyTapGesture(Gesture rhs)Constructs a KeyTapGesture object from an instance of the Gesture class.
if(gesture.Type == KeyTapGesture.ClassType()) { KeyTapGesture keytapGesture = new KeyTapGesture(gesture); }
- Since
- 1.0
- Parameters
- rhs -
The Gesture instance to specialize. This Gesture instance must be a KeyTapGesture object.
Public Static FunctionsVector Direction
The direction of finger tip motion.
Vector tapDirection = keytap.Direction;
- Return
- Vector A unit direction vector if the finger tip is moving; otherwise, a zero-vector.
- Since
- 1.0
Pointable Pointable
Vector Position
float Progress
The progress value is always 1.0 for a key tap gesture.
- Return
- float The value 1.0.
- Since
- 1.0
Gesture.GestureType ClassType()The key tap gesture type.
if(gesture.Type == KeyTapGesture.ClassType()) { KeyTapGesture keytapGesture = new KeyTapGesture(gesture); }
- Return
- Type The type value designating a key tap gesture.
- Since
- 1.0
