LeapMotion v2 中文文档
  • Introduction
  • 语言
    • Introduction
    • C++
      • 文档概述(v2.3)
      • 骨骼追踪模型概述
      • API 综述
      • 设计指南
        • 菜单设计指南
        • 用户导向与教程设计指南
        • 应用展示与营销指南
        • 用户体验设计指南
      • 应用程序开发
        • SDK 库
        • 快速入门
        • 项目设置
        • 系统架构
        • 运行时配置
        • 控制器策略
      • 使用追踪 API
        • 连接到控制器
        • 追踪模型
        • 帧
        • 手
        • 手指
        • 手势
        • 触摸仿真
        • 运动
        • 坐标系统
        • 相机图像
        • 序列化追踪数据
      • API 参考
        • Arm
        • Bone
        • CircleGesture
        • Config
        • Controller
        • Device
        • DeviceList
        • FailedDevice
        • FailedDeviceList
        • Finger
        • FingerList
        • Frame
        • Gesture
        • GestureList
        • Hand
        • HandList
        • Image
        • ImageList
        • InteractionBox
        • KeyTapGesture
        • Listener
        • Matrix
        • Pointable
        • PointableList
        • ScreenTapGesture
        • SwipeGesture
        • Tool
        • ToolList
        • Vector
      • 附录
        • Leap Motion Release Notes
        • 使用 LeapMotion 控制面板
        • 使用可视化诊断工具
        • WebSocket 通信
        • 鸣谢
    • Objective-C
      • 文档概述(v2.3)
      • 骨骼追踪模型概述
      • API 综述
      • 设计指南
        • 菜单设计指南
        • 用户导向与教程设计指南
        • 应用展示与营销指南
        • 用户体验设计指南
      • 应用程序开发
        • SDK 库
        • 快速入门
        • 项目设置
        • 系统架构
        • 运行时配置
      • 使用追踪 API
        • 连接到控制器
        • 追踪模型
        • 帧
        • 手
        • 手指
        • 手势
        • 触摸仿真
        • 运动
        • 坐标系统
        • 相机图像
        • 序列化追踪数据
      • API 参考
        • LeapArm
        • LeapBone
        • LeapCircleGesture
        • LeapConfig
        • LeapController
        • LeapDelegate
        • LeapDevice
        • DeviceList
        • LeapFinger
        • FingerList
        • LeapFrame
        • LeapGesture
        • GestureList
        • LeapHand
        • LeapImage
        • ImageList
        • LeapInteractionBox
        • LeapKeyTapGesture
        • LeapListener Protocol
        • LeapMatrix
        • LeapPointable
        • LeapPointableList
        • LeapPointableOrHandList
        • Category
        • LeapScreenTapGesture
        • LeapSwipeGesture
        • LeapTool
        • LeapVector
      • 附录
        • Leap Motion Release Notes
        • 使用 LeapMotion 控制面板
        • 使用可视化诊断工具
        • WebSocket 通信
        • 鸣谢
    • Python
      • 文档概述(v2.3)
      • 骨骼追踪模型概述
      • API 综述
      • 设计指南
        • 菜单设计指南
        • 用户导向与教程设计指南
        • 应用展示与营销指南
        • 用户体验设计指南
      • 应用程序开发
        • SDK 库
        • 快速入门
        • 项目设置
        • 系统架构
        • 运行时配置
      • 使用追踪 API
        • 连接到控制器
        • 追踪模型
        • 帧
        • 手
        • 手指
        • 手势
        • 触摸仿真
        • 运动
        • 坐标系统
        • 相机图像
        • 序列化追踪数据
      • API 参考
        • Arm
        • Bone
        • CircleGesture
        • Config
        • Controller
        • Device
        • DeviceList
        • Finger
        • FingerList
        • Frame
        • Gesture
        • GestureList
        • Hand
        • HandList
        • Image
        • ImageList
        • InteractionBox
        • KeyTapGesture
        • Listener
        • Matrix
        • Pointable
        • PointableList
        • ScreenTapGesture
        • SwipeGesture
        • Tool
        • ToolList
        • Vector
    • JavaScript
      • 文档概述(v2.3)
      • 骨骼追踪模型概述
      • API 综述
      • 设计指南
        • 菜单设计指南
        • 用户导向与教程设计指南
        • 应用展示与营销指南
        • 用户体验设计指南
      • 应用程序开发
        • SDK 库
        • 快速入门
        • 项目设置
        • 系统架构
        • 运行时配置
      • 使用追踪 API
        • 连接到控制器
        • 追踪模型
        • 帧
        • 手
        • 手指
        • 手势
        • 触摸仿真
        • 运动
        • 坐标系统
        • 相机图像
        • 序列化追踪数据
      • LeapJS 插件
      • API 参考
        • Leap namespace
        • Bone
        • CircleGesture
        • Controller
        • Finger
        • Frame
        • Gesture
        • Hand
        • InteractionBox
        • KeyTapGesture
        • Pointable
        • ScreenTapGesture
        • SwipeGesture
        • Matrix
        • Vector
      • 附录
        • Leap Motion Release Notes
        • 使用 LeapMotion 控制面板
        • 使用可视化诊断工具
        • WebSocket 通信
        • 鸣谢
Powered by GitBook
On this page
  • class Leap.KeyTapGesture
  • 构造函数
  • 属性
  • 类属性

Was this helpful?

  1. 语言
  2. Python
  3. API 参考

KeyTapGesture

PreviousInteractionBoxNextListener

Last updated 5 years ago

Was this helpful?

属性:

class Leap.KeyTapGesture

扩展自

KeyTapGesture(击键手势) 类表示手指或工具的点击手势。

击键手势识别手指指尖的旋转并返回原始位置的手势。如果要识别这个手势,那么手指必须在开始前短暂停顿。

重要:要在应用中使用击键盘手势,你需要激活击键手势识别。你可以通过下面的代码激活这种识别:

controller.enable_gesture(Leap.Gesture.TYPE_KEY_TAP);

KeyTap 手势是离散的,KeyTapGesture 对象总是表示一个点击的状态 STATE_STOP。仅当识别到屏幕点击手势后才会被创建。

你可以设置手指移动范围和速度的最小值。使用下面的键值可以进行设置:

键值

值类型

默认值

单位

Gesture.ScreenTap.MinDownVelocity

float

50

mm/s

Gesture.Swipe.HistorySeconds

float

0.1

mm

Gesture.ScreenTap.MinDistance

float

3.0

mm

下面的代码展示了如何设置这些值:

controller.config.set("Gesture.KeyTap.MinDownVelocity", 40.0)
controller.config.set("Gesture.KeyTap.HistorySeconds", .2)
controller.config.set("Gesture.KeyTap.MinDistance", 1.0)
controller.config.save()

New in Version 1.0

构造函数

classmethod KeyTapGesture([gesture])

从 Gesture 类实例中构造一个 KeyTapGesture 对象。

for gesture in frame.gestures():
    if gesture.type is Leap.Gesture.TYPE_KEY_TAP:
        key_tap = Leap.KeyTapGesture(gesture)

参数:

New in Version 1.0

属性

position

点击手势的位置。

tap_point = key_tap.position

New in Version 1.0

position

击键手势的当前位置

current = key_tap.position

New in Version 1.0

direction

手指指尖的方向。如果手指不动,那么这个手势也会被记录,并被记录为零向量。

tap_direction = key_tap.direction

New in Version 1.0

progress

类型:float

progress 值总是 1。

New in Version 1.0

pointable

执行击键手势的手指。

tapper = key_tap.pintable

New in Version 1.0

类属性

classmethod class_type()

类型:integer

击键手势类型指示器:Gesture.TYPE_KEY_TAP

gesture() - Gesture 实例专用。这个 Gesture 实例必须是一个 ScreenTapGesture 对象。如果没有给出参数,那么一个无效的 ScreenTapGesture 对象会被创建。

类型:

类型:

类型:

类型:

Gesture
Vector
Vector
Vector
Pointable
Gesture
direction
position
pointable
class_type