LeapScreenTapGesture Class Reference
Inherits from | LeapGesture : NSObject |
Declared in | LeapObjectiveC.h |
Overview
The LeapScreenTapGesture 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:
[controller enableGesture:LEAP_GESTURE_TYPE_SCREEN_TAP enable:YES];
LeapScreenTap gestures are discrete. The LeapScreenTapGesture object
representing a tap always has the state, LEAP_GESTURE_STATE_STOP. Only one
LeapScreenTapGesture 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
LeapController 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:
if([controller.config setFloat:@"Gesture.ScreenTap.MinForwardVelocity" value:30.0] &&
[controller.config setFloat:@"Gesture.ScreenTap.HistorySeconds" value:.5] &&
[controller.config setFloat:@"Gesture.ScreenTap.MinDistance" value:1.0])
[controller.config save];
Tasks
-
– position
The position where the screen tap is registered.
-
– direction
The direction of finger tip motion.
-
– progress
The progess value is always 1.0 for a screen tap gesture.
-
– pointable
The finger performing the screen tap gesture.
Instance Methods
direction
The direction of finger tip motion.
- (LeapVector *)direction
Return Value
LeapVector A unit direction vector.
Discussion
The direction of finger tip motion.
Declared In
LeapObjectiveC.h
pointable
The finger performing the screen tap gesture.
- (LeapPointable *)pointable
Return Value
A LeapPointable object representing the tapping finger.
Discussion
The finger performing the screen tap gesture.
Declared In
LeapObjectiveC.h
position
The position where the screen tap is registered.
- (LeapVector *)position
Return Value
A LeapVector containing the coordinates of screen tap location.
Discussion
The position where the screen tap is registered.
Declared In
LeapObjectiveC.h