• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# OH_NativeXComponent_MouseEvent_Callback
2
3## 概述
4
5注册鼠标事件的回调。
6
7**起始版本:** 9
8
9**相关模块:** [OH_NativeXComponent Native XComponent](capi-oh-nativexcomponent-native-xcomponent.md)
10
11**所在头文件:** [native_interface_xcomponent.h](capi-native-interface-xcomponent-h.md)
12
13## 汇总
14
15### 成员函数
16
17| 名称 | 描述 |
18| -- | -- |
19| [void (\*DispatchMouseEvent)(OH_NativeXComponent* component, void* window)](#dispatchmouseevent) | 当鼠标事件被触发时调用。 |
20| [void (\*DispatchHoverEvent)(OH_NativeXComponent* component, bool isHover)](#dispatchhoverevent) | 当悬停事件被触发时调用。 |
21
22## 成员函数说明
23
24### DispatchMouseEvent()
25
26```
27void (*DispatchMouseEvent)(OH_NativeXComponent* component, void* window)
28```
29
30**描述:**
31
32
33当鼠标事件被触发时调用。
34
35**起始版本:** 8
36
37**参数:**
38
39| 参数项                                | 描述 |
40|------------------------------------| -- |
41| [OH_NativeXComponent](capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent.md)* component | 表示指向[OH_NativeXComponent](capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent.md)实例的指针。 |
42| void* window                       | 表示NativeWindow句柄。 |
43
44### DispatchHoverEvent()
45
46```
47void (*DispatchHoverEvent)(OH_NativeXComponent* component, bool isHover)
48```
49
50**描述:**
51
52
53当悬停事件被触发时调用。
54
55**起始版本:** 8
56
57**参数:**
58
59| 参数项                                | 描述 |
60|------------------------------------| -- |
61| [OH_NativeXComponent](capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent.md)* component | 表示指向[OH_NativeXComponent](capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent.md)实例的指针。 |
62| bool isHover                       | 表示鼠标或手写笔是否悬浮在组件上,进入时为true,离开时为false。 |
63
64
65