openharmony 鸿蒙 capi-arkui-nativemodule-arkui-nativegestureapi-2

2026-08-25 浏览 (1)

ArkUI_NativeGestureAPI_2

typedef struct {...} ArkUI_NativeGestureAPI_2

概述

定义手势模块接口集合。

起始版本: 18

相关模块: ArkUI_NativeModule

所在头文件: native_gesture.h

汇总

成员变量

名称描述
ArkUI_NativeGestureAPI_1* gestureApi1指向ArkUI_NativeGestureAPI_1结构体的指针。

成员函数

名称描述
int32_t (*setGestureInterrupterToNode)(ArkUI_NodeHandle node, void* userData,ArkUI_GestureInterruptResult (*interrupter)(ArkUI_GestureInterruptInfo* info))设置手势打断事件的回调函数。

成员函数说明

setGestureInterrupterToNode()

int32_t (*setGestureInterrupterToNode)(ArkUI_NodeHandle node, void* userData, ArkUI_GestureInterruptResult (*interrupter)(ArkUI_GestureInterruptInfo* info))

描述:

设置手势打断事件的回调函数。

参数:

参数项描述
ArkUI_NodeHandle node需要被设置手势打断回调的ArkUI节点指针。
void* userData用户自定义数据。
ArkUI_GestureInterruptResult (*interrupter)(ArkUI_GestureInterruptInfo* info)打断回调,info返回手势打断数据。interrupter返回GESTURE_INTERRUPT_RESULT_CONTINUE,手势正常进行;返回GESTURE_INTERRUPT_RESULT_REJECT,手势打断。设置此参数为nullptr时将取消注册回调函数。
说明: 该事件打断回调注册后,后续在单次手势处理流程中都会存在。即使在单次事件处理流程中使用setGestureInterrupterToNode接口将手势打断回调重置为undefined,或者使用dispose接口使即将被触发的手势销毁,该回调在满足触发条件后仍会响应。如果在该回调中使用到的对象,在回调触发前已被释放,需要对该对象进行保护。

返回:

类型说明
int32_t错误码。
ARKUI_ERROR_CODE_NO_ERROR 成功。
ARKUI_ERROR_CODE_PARAM_INVALID 参数错误。

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-uicontext-contextmenucontroller

openharmony 鸿蒙 errorcode-canvas

openharmony 鸿蒙 capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent

openharmony 鸿蒙 errorcode-bindSheet

openharmony 鸿蒙 js-apis-arkui-uiExtension-sys

openharmony 鸿蒙 capi-arkui-accessibility-arkui-accessibilityeventinfo

openharmony 鸿蒙 capi-arkui-rendernodeutils

openharmony 鸿蒙 capi-native-node-h-nodeattributetype-layoutcomponent

openharmony 鸿蒙 js-apis-arkui-node

openharmony 鸿蒙 capi-native-node-h

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/5T0eUUmU