Skip to main content
版本:v3+

onWristMotion

API_LEVEL 3.0 开始支持,API 兼容性请参考 API_LEVEL。

监听手部动作事件。

类型​

function onWristMotion(option: Option): void

参数​

Option​

属性类型必填默认值说明API_LEVEL
callback(params: Params) => void是-手部动作事件回调函数3.0

Params​

属性类型说明API_LEVEL
typenumber动作类型,0 - 覆掌,3 - 腕部事件3.6
motionnumber动作代号,值参考手部动作常量3.0

常量​

手部动作常量​

常量说明API_LEVEL
WRIST_MOTION_LIFT抬腕动作2.0
WRIST_MOTION_LOWER落腕动作2.0
WRIST_MOTION_FLIP翻转手腕动作2.0

代码示例​

import { onWristMotion, WRIST_MOTION_LIFT } from '@zos/interaction'

onWristMotion({
callback: (result) => {
const { type, motion } = result

if (type === 3) {
console.log(motion === WRIST_MOTION_LIFT)
}
},
})