![]() |
Leap Motion Java API Reference
0.8.0
|
The ScreenTapGesture class represents a tapping gesture by a finger or tool. More...
Inherits com.leapmotion.leap.Gesture.
Public Member Functions | |
Vector | direction () |
The direction of finger tip motion. | |
Pointable | pointable () |
The finger performing the screen tap gesture. | |
Vector | position () |
The position where the screen tap is registered. | |
float | progress () |
The progess value is always 1.0 for a screen tap gesture. | |
ScreenTapGesture () | |
Constructs a new ScreenTapGesture object. | |
ScreenTapGesture (Gesture rhs) | |
Constructs a ScreenTapGesture object from an instance of the Gesture class. | |
![]() | |
long | duration () |
The elapsed duration of the recognized movement up to the frame containing this Gesture object, in microseconds. | |
float | durationSeconds () |
The elapsed duration in seconds. | |
boolean | equals (Gesture rhs) |
Compare Gesture object equality. | |
Frame | frame () |
The Frame containing this Gesture instance. | |
Gesture () | |
Constructs a new Gesture object. | |
Gesture (Gesture rhs) | |
Constructs a new copy of an Gesture object. | |
HandList | hands () |
The list of hands associated with this Gesture, if any. | |
int | id () |
The gesture ID. | |
boolean | isValid () |
Reports whether this Gesture instance represents a valid Gesture. | |
PointableList | pointables () |
The list of fingers and tools associated with this Gesture, if any. | |
Gesture.State | state () |
The gesture state. | |
String | toString () |
A string containing a brief, human-readable description of this Gesture. | |
Gesture.Type | type () |
The gesture type. | |
Static Public Member Functions | |
static Gesture.Type | classType () |
The screen tap gesture type. | |
![]() | |
static Gesture | invalid () |
Returns an invalid Gesture object. | |
The ScreenTapGesture class represents a tapping gesture by a finger or tool.
A screen tap gesture is recognized when the tip of a finger pokes forward and then springs back to approximately the original postion, as if tapping a vertical screen. The tapping finger must pause briefly before beginning the tap.
Important: To use screen tap gestures in your application, you must enable recognition of the screen tap gesture. You can enable recognition with:
ScreenTap gestures are discrete. The ScreenTapGesture object representing a tap always has the state, STATE_STOP. Only one ScreenTapGesture object is created for each screen tap gesture recognized.
You can set the minimum finger movement and velocity required for a movement to be recognized as a screen tap as well as adjust the detection window for evaluating the movement using the config attribute of a connected Controller object. Use the following keys to configure screen tap recognition:
Key string | Value type | Default value | Units |
---|---|---|---|
Gesture.ScreenTap.MinForwardVelocity | float | 50 | mm/s |
Gesture.ScreenTap.HistorySeconds | float | 0.1 | s |
Gesture.ScreenTap.MinDistance | float | 3.0 | mm |
The following example demonstrates how to set the screen tap configuration parameters:
com.leapmotion.leap.ScreenTapGesture.ScreenTapGesture | ( | ) |
Constructs a new ScreenTapGesture object.
An uninitialized ScreenTapGesture object is considered invalid. Get valid instances of the ScreenTapGesture class from a Frame object.
com.leapmotion.leap.ScreenTapGesture.ScreenTapGesture | ( | Gesture | rhs | ) |
Constructs a ScreenTapGesture object from an instance of the Gesture class.
rhs | The Gesture instance to specialize. This Gesture instance must be a ScreenTapGesture object. |
|
static |
The screen tap gesture type.
Vector com.leapmotion.leap.ScreenTapGesture.direction | ( | ) |
The direction of finger tip motion.
Pointable com.leapmotion.leap.ScreenTapGesture.pointable | ( | ) |
Vector com.leapmotion.leap.ScreenTapGesture.position | ( | ) |
float com.leapmotion.leap.ScreenTapGesture.progress | ( | ) |
The progess value is always 1.0 for a screen tap gesture.