• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Input_InterceptorEventCallback
2
3## Overview
4
5Defines the structure of the interceptor for callback events, including mouse events, touch events, and axis events.
6
7**Since**: 12
8
9**Related module**: [input](capi-input.md)
10
11**Header file**: [oh_input_manager.h](capi-oh-input-manager-h.md)
12
13## Summary
14
15### Member Variables
16
17| Name| Description|
18| -- | -- |
19| Input_MouseEventCallback mouseCallback | Callback for mouse events.<br>**Since**: 12|
20| Input_TouchEventCallback touchCallback | Callback for touch events.<br>**Since**: 12|
21| Input_AxisEventCallback axisCallback | Callback for axis events.<br>**Since**: 12|
22
23
24### Member functions
25
26| Name| typedef Keyword| Description|
27| -- | -- | -- |
28| [typedef void (\*Input_KeyEventCallback)(const Input_KeyEvent* keyEvent)](#input_keyeventcallback) | Input_KeyEventCallback() | Defines a lifecycle callback for **keyEvent**. If the callback is triggered, **keyEvent** will be destroyed.<br>**Since**: 12|
29| [typedef void (\*Input_MouseEventCallback)(const Input_MouseEvent* mouseEvent)](#input_mouseeventcallback) | Input_MouseEventCallback() | Defines a lifecycle callback for **mouseEvent**. If the callback is triggered, **mouseEvent** will be destroyed.<br>**Since**: 12|
30| [typedef void (\*Input_TouchEventCallback)(const Input_TouchEvent* touchEvent)](#input_toucheventcallback) | Input_TouchEventCallback() | Defines a lifecycle callback for **touchEvent**. If the callback is triggered, **touchEvent** will be destroyed.<br>**Since**: 12|
31| [typedef void (\*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent)](#input_axiseventcallback) | Input_AxisEventCallback() | Defines a lifecycle callback for **axisEvent**. If the callback is triggered, **axisEvent** will be destroyed.<br>**Since**: 12|
32| [typedef void (\*Input_DeviceAddedCallback)(int32_t deviceId)](#input_deviceaddedcallback) | Input_DeviceAddedCallback() | Defines the callback used to receive device insertion events.<br>**Since**: 13|
33| [typedef void (\*Input_DeviceRemovedCallback)(int32_t deviceId)](#input_deviceremovedcallback) | Input_DeviceRemovedCallback() | Defines the callback used to receive device removal events.<br>**Since**: 13|
34
35## Member Function Description
36
37### Input_KeyEventCallback()
38
39```
40typedef void (*Input_KeyEventCallback)(const Input_KeyEvent* keyEvent)
41```
42
43**Description**
44
45Defines a lifecycle callback for **keyEvent**. If the callback is triggered, **keyEvent** will be destroyed.
46
47**Since**: 12
48
49**Parameters**
50
51| Name| Description|
52| -- | -- |
53| const [Input_KeyEvent](capi-input-input-keyevent.md)* keyEvent | Key event object.|
54
55### Input_MouseEventCallback()
56
57```
58typedef void (*Input_MouseEventCallback)(const Input_MouseEvent* mouseEvent)
59```
60
61**Description**
62
63Defines a lifecycle callback for **mouseEvent**. If the callback is triggered, **mouseEvent** will be destroyed.
64
65**Since**: 12
66
67**Parameters**
68
69| Name| Description|
70| -- | -- |
71| const [Input_MouseEvent](capi-input-input-mouseevent.md)* mouseEvent | Mouse event object.|
72
73### Input_TouchEventCallback()
74
75```
76typedef void (*Input_TouchEventCallback)(const Input_TouchEvent* touchEvent)
77```
78
79**Description**
80
81Defines a lifecycle callback for **touchEvent**. If the callback is triggered, **touchEvent** will be destroyed.
82
83**Since**: 12
84
85**Parameters**
86
87| Name| Description|
88| -- | -- |
89| const [Input_TouchEvent](capi-input-input-touchevent.md)* touchEvent | Touch event object.|
90
91### Input_AxisEventCallback()
92
93```
94typedef void (*Input_AxisEventCallback)(const Input_AxisEvent* axisEvent)
95```
96
97**Description**
98
99Defines a lifecycle callback for **axisEvent**. If the callback is triggered, **axisEvent** will be destroyed.
100
101**Since**: 12
102
103**Parameters**
104
105| Name| Description|
106| -- | -- |
107| const [Input_AxisEvent](capi-input-input-axisevent.md)* axisEvent | Axis event object.|
108
109### Input_DeviceAddedCallback()
110
111```
112typedef void (*Input_DeviceAddedCallback)(int32_t deviceId)
113```
114
115**Description**
116
117Defines the callback used to receive device insertion events.
118
119**Since**: 13
120
121**Parameters**
122
123| Name| Description|
124| -- | -- |
125| int32_t deviceId | Device ID.|
126
127### Input_DeviceRemovedCallback()
128
129```
130typedef void (*Input_DeviceRemovedCallback)(int32_t deviceId)
131```
132
133**Description**
134
135Defines the callback used to receive device removal events.
136
137**Since**: 13
138
139**Parameters**
140
141| Name| Description|
142| -- | -- |
143| int32_t deviceId | Device ID.|
144