KeyTapGesture类(Leap:: KeyTapGesture)
来源:互联网 发布:南昌哪里有mac魅可专柜 编辑:程序博客网 时间:2024/05/14 09:13
KeyTapGesture类(Leap:: KeyTapGesture)
这个类代表了手指或工具的一种点击手势。当手指的顶端向下转向手掌,然后回弹到原来的位置,如同点击一样,则被识别为按键点击手势。在开始点击之前,点击的手指一定要简短的暂停。注意,为了在应用程序中用这个手势,一定要打开使能“开关”,见Gesture类。
按键点击手势是离散的,描述点击的KeyTapGesture对象总是会有停止的状态:STATE_STOP。每个识别了的按键点击手势只创建一个KeyTapGesture对象。
可以用一个连接了的Controller对象的配置属性来设置把一个运动识别为按键点击所要求的手指移动和速率的最小值,还要调整检测窗口来估计运动。用以下keys来配置按键点击识别:
下面的例子说明了如何配置这些参数,在设置这些参数之前要把Controller对象和Leap Motion的服务/守护进程连接起来。
controller.config().setFloat(“Gesture. KeyTap.MinDownVelocity”, 40.0);
controller.config().setFloat(“Gesture. KeyTap.HistorySeconds”, .2);
controller.config().setFloat(“Gesture. KeyTap.MinDistance”, 8.0);
controller.config().save();
Vector direction(): 表示手指顶端的运动方向。
用法:Leap::Vector tapDirection=keytap.direction();
KeyTapGesture(): 表示构造一个新的KeyTapGesture对象。没有初始化的Gesture对象被认为是无效的。从Frame对象中得到KeyTapGesture类的有效的实例。
KeyTapGesture(const Gesture & rhs): 表示从一个Gesture对象的实例中构造出一个KeyTapGesture对象。参数rhs是需要特定化的Gesture实例,一定要是KeyTapGesture对象。
用法:if (gesture.type()==Leap:: KeyTapGesture:: classType())
KeyTapGesture =Leap:: KeyTapGesture(gesture);
Pointable pointable(): 表示实现这个按键点击手势的手指。
用法:Leap:: Pointable tappingPointable=keytap.pointable();
Vector position(): 表示记录按键点击的位置。
用法:Leap::Vector tapPosition=keytap.position();
float progress(): 对于按键点击手势,这个值始终为1.
Type classType(): 表示按键点击手势的类别。返回TYPE_KEY_TAP。
译自:https://developer.leapmotion.com/documentation/cpp/api/Leap.KeyTapGesture.html
- KeyTapGesture类(Leap:: KeyTapGesture)
- Controller类(Leap:: Controller)
- Lisener类(Leap:: Lisener)
- Config类(Leap::Config)
- Frame类(Leap::Frame)
- Pointable类(Leap::Pointable)
- PointableList类(Leap:: PointableList)
- Arm类(Leap::Arm)
- Hand类(Leap::Hand)
- HandList类(Leap:: HandList)
- Finger类(Leap::Finger)
- FingerList类(Leap:: FingerList)
- Bone类(Leap::Bone)
- CircleGesture类(Leap:: CircleGesture)
- SwipeGesture类(Leap:: SwipeGesture)
- ScreenTapGesture类(Leap:: ScreenTapGesture)
- Device类(Leap:: Device)和 DeviceList类(Leap:: DeviceList)
- Tool类(Leap::Tool)和ToolList类(Leap::ToolList)
- 菜鸟成长之node.js环境搭建与配置-windows
- 使程序同时支持iphone和ipad
- QT中QWS的含义
- 第四周项目3-单链表应用
- Android往SD卡写数据范例
- KeyTapGesture类(Leap:: KeyTapGesture)
- Android | java.lang.IllegalStateException: The specified child already has a parent. 解决方案
- 测试12222222222
- 游戏场景切换的问题
- redis与memcache对比
- 深入浅出Extjs4.1.1视频教程
- 一根网线+连接wifi的笔记本+树莓派联网
- mesos和Elasticsearch设计(Docker部署)(二)
- Android判断Service是否开启