• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# OH_NativeXComponent_TouchEvent
2<!--Kit: ArkUI-->
3<!--Subsystem: ArkUI-->
4<!--Owner: @zjsxstar-->
5<!--Designer: @sunbees-->
6<!--Tester: @liuli0427-->
7<!--Adviser: @HelloCrease-->
8
9## 概述
10
11触摸事件。
12
13**起始版本:** 8
14
15**相关模块:** [OH_NativeXComponent Native XComponent](capi-oh-nativexcomponent-native-xcomponent.md)
16
17**所在头文件:** [native_interface_xcomponent.h](capi-native-interface-xcomponent-h.md)
18
19## 汇总
20
21### 成员变量
22
23| 名称 | 描述 |
24| -- | -- |
25| int32_t id | 手指的唯一标识符。 |
26| float screenX | 触摸点相对于XComponent所在应用窗口左上角的x坐标。 |
27| float screenY | 触摸点相对于XComponent所在应用窗口左上角的y坐标。 |
28| float x | 触摸点相对于XComponent组件左边缘的x坐标。 |
29| float y | 触摸点相对于XComponent组件上边缘的y坐标。 |
30| [OH_NativeXComponent_TouchEventType](capi-native-interface-xcomponent-h.md#oh_nativexcomponent_toucheventtype) type | 触摸事件的触摸类型。 |
31| double size | 指垫和屏幕之间的接触面积。 |
32| float force | 当前触摸事件的压力。 |
33| int64_t deviceId | 产生当前触摸事件的设备的ID。 |
34| int64_t timeStamp | 当前触摸事件的时间戳。触发事件时距离系统启动的时间间隔,单位纳秒。 |
35| [OH_NativeXComponent_TouchPoint](capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent-touchpoint.md) touchPoints[OH_MAX_TOUCH_POINTS_NUMBER] | 当前触摸点的数组。 |
36| uint32_t numPoints | 当前接触点的数量,值为1时为单指触摸,大于1时为多指触摸。 |
37
38
39