1# ArkUI_EventModule 2 3 4## Overview 5 6Declares the UI input event capabilities provided by ArkUI on the native side. 7 8**Since**: 12 9 10 11## Summary 12 13 14### File 15 16| Name| Description| 17| -------- | -------- | 18| [ui_input_event.h](ui__input__event_8h.md) | Provides ArkUI event definitions on the native side.<br> **Library**: libace_ndk.z.so| 19 20 21### Types 22 23| Name| Description| 24| -------- | -------- | 25| typedef struct [ArkUI_UIInputEvent](#arkui_uiinputevent) [ArkUI_UIInputEvent](#arkui_uiinputevent) | Defines the UI input event. | 26 27 28### Enums 29 30| Name| Description| 31| -------- | -------- | 32| [ArkUI_UIInputEvent_Type](#arkui_uiinputevent_type) { ARKUI_UIINPUTEVENT_TYPE_UNKNOWN = 0, ARKUI_UIINPUTEVENT_TYPE_TOUCH = 1, ARKUI_UIINPUTEVENT_TYPE_AXIS = 2, ARKUI_UIINPUTEVENT_TYPE_MOUSE = 3 } | Enumerates the UI input event types. | 33| {<br>OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0, OH_NATIVEXCOMPONENT_RESULT_FAILED = -1, OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2, UI_TOUCH_EVENT_ACTION_CANCEL = 0,<br>UI_TOUCH_EVENT_ACTION_DOWN = 1, UI_TOUCH_EVENT_ACTION_MOVE = 2, UI_TOUCH_EVENT_ACTION_UP = 3<br>} | Enumerates the action codes of the input event. | 34| {<br>UI_INPUT_EVENT_TOOL_TYPE_UNKNOWN = 0, UI_INPUT_EVENT_TOOL_TYPE_FINGER = 1, UI_INPUT_EVENT_TOOL_TYPE_PEN = 2, UI_INPUT_EVENT_TOOL_TYPE_MOUSE = 3,<br>UI_INPUT_EVENT_TOOL_TYPE_TOUCHPAD = 4, UI_INPUT_EVENT_TOOL_TYPE_JOYSTICK = 5<br>} | Enumerates the tool types of the input event. | 35| { UI_INPUT_EVENT_SOURCE_TYPE_UNKNOWN = 0, UI_INPUT_EVENTT_SOURCE_TYPE_MOUSE = 1, UI_INPUT_EVENTT_SOURCE_TYPE_TOUCH_SCREEN = 2 } | Enumerates the source types of the input event. | 36| [HitTestMode](#hittestmode) { HTMDEFAULT = 0, HTMBLOCK, HTMTRANSPARENT, HTMNONE } | Enumerates the hit test modes. | 37| { UI_MOUSE_EVENT_ACTION_UNKNOWN = 0, UI_MOUSE_EVENT_ACTION_PRESS = 1, UI_MOUSE_EVENT_ACTION_RELEASE = 2, UI_MOUSE_EVENT_ACTION_MOVE = 3 } | Enumerates the action codes of the mouse event. | 38| {<br>UI_MOUSE_EVENT_BUTTON_NONE = 0, UI_MOUSE_EVENT_BUTTON_LEFT = 1, UI_MOUSE_EVENT_BUTTON_RIGHT = 2, UI_MOUSE_EVENT_BUTTON_MIDDLE = 3,<br>UI_MOUSE_EVENT_BUTTON_BACK = 4, UI_MOUSE_EVENT_BUTTON_FORWARD = 5<br>} | Enumerates the button types of the mouse event. | 39| [ArkUI_ModifierKeyName](#arkui_modifierkeyname) { ARKUI_MODIFIER_KEY_CTRL = 1 << 0, ARKUI_MODIFIER_KEY_SHIFT = 1 << 1, ARKUI_MODIFIER_KEY_ALT = 1 << 2, ARKUI_MODIFIER_KEY_FN = 1 << 3 } | Enumerates the modifier keys. | 40 41 42### Functions 43 44| Name| Description| 45| -------- | -------- | 46| int32_t [OH_ArkUI_UIInputEvent_GetType](#oh_arkui_uiinputevent_gettype) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the type of a UI input event. | 47| int32_t [OH_ArkUI_UIInputEvent_GetAction](#oh_arkui_uiinputevent_getaction) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the action type of this UI input event. | 48| int32_t [OH_ArkUI_UIInputEvent_GetSourceType](#oh_arkui_uiinputevent_getsourcetype) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the source type of a UI input event. | 49| int32_t [OH_ArkUI_UIInputEvent_GetToolType](#oh_arkui_uiinputevent_gettooltype) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the tool type of a UI input event. | 50| int64_t [OH_ArkUI_UIInputEvent_GetEventTime](#oh_arkui_uiinputevent_geteventtime) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the time when a specified UI input event occurs. | 51| uint32_t [OH_ArkUI_PointerEvent_GetPointerCount](#oh_arkui_pointerevent_getpointercount) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the number of touch points from a directional input event (such as a touch event, mouse event, or axis event). | 52| int32_t [OH_ArkUI_PointerEvent_GetPointerId](#oh_arkui_pointerevent_getpointerid) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the ID of a touch point from a directional input event (such as a touch event, mouse event, or axis event). | 53| float [OH_ArkUI_PointerEvent_GetX](#oh_arkui_pointerevent_getx) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the X-coordinate relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). | 54| float [OH_ArkUI_PointerEvent_GetXByIndex](#oh_arkui_pointerevent_getxbyindex) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the X-coordinate of a specific touch point relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). | 55| float [OH_ArkUI_PointerEvent_GetY](#oh_arkui_pointerevent_gety) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the Y-coordinate relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). | 56| float [OH_ArkUI_PointerEvent_GetYByIndex](#oh_arkui_pointerevent_getybyindex) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the Y-coordinate of a specific touch point relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). | 57| float [OH_ArkUI_PointerEvent_GetWindowX](#oh_arkui_pointerevent_getwindowx) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the X-coordinate relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). | 58| float [OH_ArkUI_PointerEvent_GetWindowXByIndex](#oh_arkui_pointerevent_getwindowxbyindex) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the X-coordinate of a specific touch point relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). | 59| float [OH_ArkUI_PointerEvent_GetWindowY](#oh_arkui_pointerevent_getwindowy) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the Y-coordinate relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). | 60| float [OH_ArkUI_PointerEvent_GetWindowYByIndex](#oh_arkui_pointerevent_getwindowybyindex) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the Y-coordinate of a specific touch point relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). | 61| float [OH_ArkUI_PointerEvent_GetDisplayX](#oh_arkui_pointerevent_getdisplayx) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the X-coordinate relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). | 62| float [OH_ArkUI_PointerEvent_GetDisplayXByIndex](#oh_arkui_pointerevent_getdisplayxbyindex) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the X-coordinate of a specific touch point relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). | 63| float [OH_ArkUI_PointerEvent_GetDisplayY](#oh_arkui_pointerevent_getdisplayy) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the Y-coordinate relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). | 64| float [OH_ArkUI_PointerEvent_GetDisplayYByIndex](#oh_arkui_pointerevent_getdisplayybyindex) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the Y-coordinate of a specific touch point relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). | 65| float [OH_ArkUI_PointerEvent_GetPressure](#oh_arkui_pointerevent_getpressure) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the pressure applied to the touchscreen from a directional input event (for example, a touch event). | 66| float [OH_ArkUI_PointerEvent_GetTiltX](#oh_arkui_pointerevent_gettiltx) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the angle relative to the YZ plane from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a rightward tilt. | 67| float [OH_ArkUI_PointerEvent_GetTiltY](#oh_arkui_pointerevent_gettilty) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the angle relative to the XZ plane from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a downward tilt. | 68| float [OH_ArkUI_PointerEvent_GetTouchAreaWidth](#oh_arkui_pointerevent_gettouchareawidth) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the width of the touch area from a directional input event (for example, a touch event). | 69| float [OH_ArkUI_PointerEvent_GetTouchAreaHeight](#oh_arkui_pointerevent_gettouchareaheight) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex) | Obtains the height of the touch area from a directional input event (for example, a touch event). | 70| uint32_t [OH_ArkUI_PointerEvent_GetHistorySize](#oh_arkui_pointerevent_gethistorysize) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the number of historical events from a directional input event (such as a touch event, mouse event, or axis event). | 71| int64_t [OH_ArkUI_PointerEvent_GetHistoryEventTime](#oh_arkui_pointerevent_gethistoryeventtime) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t historyIndex) | Obtains the occurrence time of a historical event from a directional input event (such as a touch event, mouse event, or axis event). | 72| uint32_t [OH_ArkUI_PointerEvent_GetHistoryPointerCount](#oh_arkui_pointerevent_gethistorypointercount) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t historyIndex) | Obtains the number of touch points in a specific historical event from a directional input event (such as a touch event, mouse event, or axis event). | 73| int32_t [OH_ArkUI_PointerEvent_GetHistoryPointerId](#oh_arkui_pointerevent_gethistorypointerid) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the ID of a touch point from a directional input event (such as a touch event, mouse event, or axis event). | 74| float [OH_ArkUI_PointerEvent_GetHistoryX](#oh_arkui_pointerevent_gethistoryx) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the X-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). | 75| float [OH_ArkUI_PointerEvent_GetHistoryY](#oh_arkui_pointerevent_gethistoryy) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the Y-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). | 76| float [OH_ArkUI_PointerEvent_GetHistoryWindowX](#oh_arkui_pointerevent_gethistorywindowx) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the X-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). | 77| float [OH_ArkUI_PointerEvent_GetHistoryWindowY](#oh_arkui_pointerevent_gethistorywindowy) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the Y-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). | 78| float [OH_ArkUI_PointerEvent_GetHistoryDisplayX](#oh_arkui_pointerevent_gethistorydisplayx) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the X-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). | 79| float [OH_ArkUI_PointerEvent_GetHistoryDisplayY](#oh_arkui_pointerevent_gethistorydisplayy) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the Y-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). | 80| float [OH_ArkUI_PointerEvent_GetHistoryPressure](#oh_arkui_pointerevent_gethistorypressure) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the pressure applied to the touchscreen in a specific historical event from a directional input event (for example, a touch event).. | 81| float [OH_ArkUI_PointerEvent_GetHistoryTiltX](#oh_arkui_pointerevent_gethistorytiltx) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the angle relative to the YZ plane in a specific historical event from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a rightward tilt. | 82| float [OH_ArkUI_PointerEvent_GetHistoryTiltY](#oh_arkui_pointerevent_gethistorytilty) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the angle relative to the XZ plane in a specific historical event from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a downward tilt. | 83| float [OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth](#oh_arkui_pointerevent_gethistorytouchareawidth) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the width of the touch area in a specific historical event from a directional input event (for example, a touch event). | 84| float [OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight](#oh_arkui_pointerevent_gethistorytouchareaheight) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, uint32_t pointerIndex, uint32_t historyIndex) | Obtains the height of the touch area in a specific historical event from a directional input event (for example, a touch event). | 85| double [OH_ArkUI_AxisEvent_GetVerticalAxisValue](#oh_arkui_axisevent_getverticalaxisvalue) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the value of the vertical scroll axis for this axis event. | 86| double [OH_ArkUI_AxisEvent_GetHorizontalAxisValue](#oh_arkui_axisevent_gethorizontalaxisvalue) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the value of the horizontal scroll axis for this axis event. | 87| double [OH_ArkUI_AxisEvent_GetPinchAxisScaleValue](#oh_arkui_axisevent_getpinchaxisscalevalue) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the scale value of the pinch axis for this axis event. | 88| int32_t [OH_ArkUI_PointerEvent_SetInterceptHitTestMode](#oh_arkui_pointerevent_setintercepthittestmode) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, [HitTestMode](#hittestmode) mode) | Sets how the component behaves during hit testing. | 89| int32_t [OH_ArkUI_MouseEvent_GetMouseButton](#oh_arkui_mouseevent_getmousebutton) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the button type of a mouse event. | 90| int32_t [OH_ArkUI_MouseEvent_GetMouseAction](#oh_arkui_mouseevent_getmouseaction) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event) | Obtains the action type of a mouse event. | 91| int32_t [OH_ArkUI_PointerEvent_SetStopPropagation](#oh_arkui_pointerevent_setstoppropagation) (const [ArkUI_UIInputEvent](#arkui_uiinputevent) \*event, bool stopPropagation) | Sets whether to stop event propagation. | 92 93 94## Type Description 95 96 97### ArkUI_UIInputEvent 98 99``` 100typedef struct ArkUI_UIInputEvent ArkUI_UIInputEvent 101``` 102**Description** 103 104Defines the UI input event. 105 106**Since**: 12 107 108 109## Enum Description 110 111 112### anonymous enum 113 114``` 115anonymous enum 116``` 117**Description** 118 119Enumerates the action codes of the input event. 120 121**Since**: 12 122 123| Value| Description| 124| -------- | -------- | 125| OH_NATIVEXCOMPONENT_RESULT_SUCCESS | Success. | 126| OH_NATIVEXCOMPONENT_RESULT_FAILED | Failure. | 127| OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER | Invalid parameter. | 128| UI_TOUCH_EVENT_ACTION_CANCEL | Cancellation of touch. | 129| UI_TOUCH_EVENT_ACTION_DOWN | Pressing of touch. | 130| UI_TOUCH_EVENT_ACTION_MOVE | Moving of touch. | 131| UI_TOUCH_EVENT_ACTION_UP | Lifting of touch. | 132 133 134### anonymous enum 135 136``` 137anonymous enum 138``` 139**Description** 140 141Enumerates the tool types of the input event. 142 143**Since**: 12 144 145| Value| Description| 146| -------- | -------- | 147| UI_INPUT_EVENT_TOOL_TYPE_UNKNOWN | Unknown tool type. | 148| UI_INPUT_EVENT_TOOL_TYPE_FINGER | Finger. | 149| UI_INPUT_EVENT_TOOL_TYPE_PEN | Stylus. | 150| UI_INPUT_EVENT_TOOL_TYPE_MOUSE | Mouse. | 151| UI_INPUT_EVENT_TOOL_TYPE_TOUCHPAD | Touchpad. | 152| UI_INPUT_EVENT_TOOL_TYPE_JOYSTICK | Joystick. | 153 154 155### anonymous enum 156 157``` 158anonymous enum 159``` 160**Description** 161 162Enumerates the source types of the input event. 163 164**Since**: 12 165 166| Value| Description| 167| -------- | -------- | 168| UI_INPUT_EVENT_SOURCE_TYPE_UNKNOWN | Unknown source type. | 169| UI_INPUT_EVENTT_SOURCE_TYPE_MOUSE | Mouse. | 170| UI_INPUT_EVENTT_SOURCE_TYPE_TOUCH_SCREEN | Touchscreen. | 171 172 173### anonymous enum 174 175``` 176anonymous enum 177``` 178**Description** 179 180Enumerates the action codes of the mouse event. 181 182**Since**: 12 183 184| Value| Description| 185| -------- | -------- | 186| UI_MOUSE_EVENT_ACTION_UNKNOWN | Unknown action. | 187| UI_MOUSE_EVENT_ACTION_PRESS | The mouse button is pressed. | 188| UI_MOUSE_EVENT_ACTION_RELEASE | The mouse button is released. | 189| UI_MOUSE_EVENT_ACTION_MOVE | The mouse cursor moves. | 190 191 192### anonymous enum 193 194``` 195anonymous enum 196``` 197**Description** 198 199Enumerates the button types of the mouse event. 200 201**Since**: 12 202 203| Value| Description| 204| -------- | -------- | 205| UI_MOUSE_EVENT_BUTTON_NONE | No button. | 206| UI_MOUSE_EVENT_BUTTON_LEFT | Left button on the mouse. | 207| UI_MOUSE_EVENT_BUTTON_RIGHT | Right button on the mouse. | 208| UI_MOUSE_EVENT_BUTTON_MIDDLE | Middle button on the mouse. | 209| UI_MOUSE_EVENT_BUTTON_BACK | Back button on the left of the mouse. | 210| UI_MOUSE_EVENT_BUTTON_FORWARD | Forward button on the left of the mouse. | 211 212 213### ArkUI_ModifierKeyName 214 215``` 216enum ArkUI_ModifierKeyName 217``` 218**Description** 219 220Enumerates the modifier keys. 221 222**Since**: 12 223 224| Value| Description| 225| -------- | -------- | 226| ARKUI_MODIFIER_KEY_CTRL | Ctrl. | 227| ARKUI_MODIFIER_KEY_SHIFT | Shift. | 228| ARKUI_MODIFIER_KEY_ALT | Alt. | 229| ARKUI_MODIFIER_KEY_FN | Fn. | 230 231 232### ArkUI_UIInputEvent_Type 233 234``` 235enum ArkUI_UIInputEvent_Type 236``` 237**Description** 238 239Enumerates the UI input event types. 240 241**Since**: 12 242 243 244### HitTestMode 245 246``` 247enum HitTestMode 248``` 249**Description** 250 251Enumerates the hit test modes. 252 253**Since**: 12 254 255| Value| Description| 256| -------- | -------- | 257| HTMDEFAULT | Both the node and its child node respond to the hit test of a touch event, but its sibling node is blocked from the hit test. | 258| HTMBLOCK | The node responds to the hit test of a touch event, but its child node and sibling node are blocked from the hit test. | 259| HTMTRANSPARENT | Both the node and its child node respond to the hit test of a touch event, and its sibling node is also considered during the hit test. | 260| HTMNONE | The node does not respond to the hit test of a touch event, but its child node and sibling node are considered during the hit test. | 261 262 263## Function Description 264 265 266### OH_ArkUI_AxisEvent_GetHorizontalAxisValue() 267 268``` 269double OH_ArkUI_AxisEvent_GetHorizontalAxisValue (const ArkUI_UIInputEvent * event) 270``` 271**Description** 272 273Obtains the value of the horizontal scroll axis for this axis event. 274 275**Since**: 12 276 277**Parameters** 278 279| Name| Description| 280| -------- | -------- | 281| event | Pointer to the UI input event. | 282 283**Returns** 284 285Returns the value of the horizontal scroll axis of the current axis event; returns **0.0** if any parameter error occurs. 286 287 288### OH_ArkUI_AxisEvent_GetPinchAxisScaleValue() 289 290``` 291double OH_ArkUI_AxisEvent_GetPinchAxisScaleValue (const ArkUI_UIInputEvent * event) 292``` 293**Description** 294 295Obtains the scale value of the pinch axis for this axis event. 296 297**Since**: 12 298 299**Parameters** 300 301| Name| Description| 302| -------- | -------- | 303| event | Pointer to the UI input event. | 304 305**Returns** 306 307Returns the scale value of the pinch axis of the current axis event; returns **0.0** if any parameter error occurs. 308 309 310### OH_ArkUI_AxisEvent_GetVerticalAxisValue() 311 312``` 313double OH_ArkUI_AxisEvent_GetVerticalAxisValue (const ArkUI_UIInputEvent * event) 314``` 315**Description** 316 317Obtains the value of the vertical scroll axis for this axis event. 318 319**Since**: 12 320 321**Parameters** 322 323| Name| Description| 324| -------- | -------- | 325| event | Pointer to the UI input event. | 326 327**Returns** 328 329Returns the value of the vertical scroll axis of the current axis event; returns **0.0** if any parameter error occurs. 330 331 332### OH_ArkUI_MouseEvent_GetMouseAction() 333 334``` 335int32_t OH_ArkUI_MouseEvent_GetMouseAction (const ArkUI_UIInputEvent * event) 336``` 337**Description** 338 339Obtains the action type of a mouse event. 340 341**Since**: 12 342 343**Parameters** 344 345| Name| Description| 346| -------- | -------- | 347| event | Pointer to the UI input event. | 348 349**Returns** 350 351Returns the mouse action type. The value **1** indicates that the mouse button is pressed, **2** indicates that the mouse button is released, and **3** indicates that the mouse cursor moves. 352 353 354### OH_ArkUI_MouseEvent_GetMouseButton() 355 356``` 357int32_t OH_ArkUI_MouseEvent_GetMouseButton (const ArkUI_UIInputEvent * event) 358``` 359**Description** 360 361Obtains the button type of a mouse event. 362 363**Since**: 12 364 365**Parameters** 366 367| Name| Description| 368| -------- | -------- | 369| event | Pointer to the UI input event. | 370 371**Returns** 372 373Returns the mouse button type. The value **1** indicates the left button, **2** indicates the right button, **3** indicates the middle button, **4** indicates the back button, and **5** indicates the forward button. 374 375 376### OH_ArkUI_PointerEvent_GetDisplayX() 377 378``` 379float OH_ArkUI_PointerEvent_GetDisplayX (const ArkUI_UIInputEvent * event) 380``` 381**Description** 382 383Obtains the X-coordinate relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). 384 385**Since**: 12 386 387**Parameters** 388 389| Name| Description| 390| -------- | -------- | 391| event | Pointer to the UI input event. | 392 393**Returns** 394 395Returns the X-coordinate relative to the upper left corner of the current screen; returns **0.0f** if any parameter error occurs. 396 397 398### OH_ArkUI_PointerEvent_GetDisplayXByIndex() 399 400``` 401float OH_ArkUI_PointerEvent_GetDisplayXByIndex (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 402``` 403**Description** 404 405Obtains the X-coordinate of a specific touch point relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). 406 407**Since**: 12 408 409**Parameters** 410 411| Name| Description| 412| -------- | -------- | 413| event | Pointer to the UI input event. | 414| pointerIndex | Index of the target touch point in the multi-touch data list. | 415 416**Returns** 417 418Returns the X-coordinate relative to the upper left corner of the current screen; returns **0.0f** if any parameter error occurs. 419 420### OH_ArkUI_PointerEvent_GetDisplayY() 421 422``` 423float OH_ArkUI_PointerEvent_GetDisplayY (const ArkUI_UIInputEvent * event) 424``` 425**Description** 426 427Obtains the Y-coordinate relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). 428 429**Since**: 12 430 431**Parameters** 432 433| Name| Description| 434| -------- | -------- | 435| event | Pointer to the UI input event. | 436 437**Returns** 438 439Returns the Y-coordinate relative to the upper left corner of the current screen; returns **0.0f** if any parameter error occurs. 440 441 442### OH_ArkUI_PointerEvent_GetDisplayYByIndex() 443 444``` 445float OH_ArkUI_PointerEvent_GetDisplayYByIndex (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 446``` 447**Description** 448 449Obtains the Y-coordinate of a specific touch point relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). 450 451**Since**: 12 452 453**Parameters** 454 455| Name| Description| 456| -------- | -------- | 457| event | Pointer to the UI input event. | 458| pointerIndex | Index of the target touch point in the multi-touch data list. | 459 460**Returns** 461 462Returns the Y-coordinate relative to the upper left corner of the current screen; returns **0.0f** if any parameter error occurs. 463 464 465### OH_ArkUI_PointerEvent_GetHistoryDisplayX() 466 467``` 468float OH_ArkUI_PointerEvent_GetHistoryDisplayX (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 469``` 470**Description** 471 472Obtains the X-coordinate of a specific touch point in a historical event relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). 473 474**Since**: 12 475 476**Parameters** 477 478| Name| Description| 479| -------- | -------- | 480| event | Pointer to the UI input event. | 481| pointerIndex | Index of the target touch point in the multi-touch data list. | 482| historyIndex | Index of the target historical event. | 483 484**Returns** 485 486Returns the X-coordinate relative to the upper left corner of the current screen; returns **0.0f** if any parameter error occurs. 487 488 489### OH_ArkUI_PointerEvent_GetHistoryDisplayY() 490 491``` 492float OH_ArkUI_PointerEvent_GetHistoryDisplayY (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 493``` 494**Description** 495 496Obtains the Y-coordinate of a specific touch point in a historical event relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). 497 498**Since**: 12 499 500**Parameters** 501 502| Name| Description| 503| -------- | -------- | 504| event | Pointer to the UI input event. | 505| pointerIndex | Index of the target touch point in the multi-touch data list. | 506| historyIndex | Index of the target historical event. | 507 508**Returns** 509 510Returns the Y-coordinate relative to the upper left corner of the current screen; returns **0.0f** if any parameter error occurs. 511 512 513### OH_ArkUI_PointerEvent_GetHistoryEventTime() 514 515``` 516int64_t OH_ArkUI_PointerEvent_GetHistoryEventTime (const ArkUI_UIInputEvent * event, uint32_t historyIndex ) 517``` 518**Description** 519 520Obtains the occurrence time of a historical event from a directional input event (such as a touch event, mouse event, or axis event). 521 522**Since**: 12 523 524**Parameters** 525 526| Name| Description| 527| -------- | -------- | 528| event | Pointer to the UI input event. | 529| historyIndex | Index of the target historical event. | 530 531**Returns** 532 533Returns the time when the UI input event occurs; returns **0** if any parameter error occurs. 534 535 536### OH_ArkUI_PointerEvent_GetHistoryPointerCount() 537 538``` 539uint32_t OH_ArkUI_PointerEvent_GetHistoryPointerCount (const ArkUI_UIInputEvent * event, uint32_t historyIndex ) 540``` 541**Description** 542 543Obtains the number of touch points in a historical event from a directional input event (such as a touch event, mouse event, or axis event). 544 545**Since**: 12 546 547**Parameters** 548 549| Name| Description| 550| -------- | -------- | 551| event | Pointer to the UI input event. | 552| historyIndex | Index of the target historical event. | 553 554**Returns** 555 556Returns the number of touch points in the specified historical event 557 558 559### OH_ArkUI_PointerEvent_GetHistoryPointerId() 560 561``` 562int32_t OH_ArkUI_PointerEvent_GetHistoryPointerId (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 563``` 564**Description** 565 566Obtains the ID of a touch point from a directional input event (such as a touch event, mouse event, or axis event). 567 568**Since**: 12 569 570**Parameters** 571 572| Name| Description| 573| -------- | -------- | 574| event | Pointer to the UI input event. | 575| pointerIndex | Index of the target touch point in the multi-touch data list. | 576| historyIndex | Index of the target historical event. | 577 578**Returns** 579 580Returns the ID of the corresponding touch point in the specified historical event. 581 582 583### OH_ArkUI_PointerEvent_GetHistoryPressure() 584 585``` 586float OH_ArkUI_PointerEvent_GetHistoryPressure (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 587``` 588**Description** 589 590Obtains the pressure applied to the touchscreen in a historical event from a directional input event (for example, a touch event).. 591 592**Since**: 12 593 594**Parameters** 595 596| Name| Description| 597| -------- | -------- | 598| event | Pointer to the UI input event. | 599| pointerIndex | Index of the target touch point in the multi-touch data list. | 600| historyIndex | Index of the target historical event. | 601 602**Returns** 603 604Returns the pressure applied to the touchscreen; returns **0.0f** if any parameter error occurs. 605 606 607### OH_ArkUI_PointerEvent_GetHistorySize() 608 609``` 610uint32_t OH_ArkUI_PointerEvent_GetHistorySize (const ArkUI_UIInputEvent * event) 611``` 612**Description** 613 614Obtains the number of historical events from a directional input event (such as a touch event, mouse event, or axis event). 615 616**Since**: 12 617 618**Parameters** 619 620| Name| Description| 621| -------- | -------- | 622| event | Pointer to the UI input event. | 623 624**Returns** 625 626Returns the number of historical events. 627 628 629### OH_ArkUI_PointerEvent_GetHistoryTiltX() 630 631``` 632float OH_ArkUI_PointerEvent_GetHistoryTiltX (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 633``` 634**Description** 635 636Obtains the angle relative to the YZ plane in a historical event from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a rightward tilt. 637 638**Since**: 12 639 640**Parameters** 641 642| Name| Description| 643| -------- | -------- | 644| event | Pointer to the UI input event. | 645| pointerIndex | Index of the target touch point in the multi-touch data list. | 646| historyIndex | Index of the target historical event. | 647 648**Returns** 649 650Returns the angle relative to the YZ plane. 651 652 653### OH_ArkUI_PointerEvent_GetHistoryTiltY() 654 655``` 656float OH_ArkUI_PointerEvent_GetHistoryTiltY (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 657``` 658**Description** 659 660Obtains the angle relative to the XZ plane in a historical event from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a downward tilt. 661 662**Since**: 12 663 664**Parameters** 665 666| Name| Description| 667| -------- | -------- | 668| event | Pointer to the UI input event. | 669| pointerIndex | Index of the target touch point in the multi-touch data list. | 670| historyIndex | Index of the target historical event. | 671 672**Returns** 673 674Returns the angle relative to the XZ plane. 675 676 677### OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight() 678 679``` 680float OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 681``` 682**Description** 683 684Obtains the height of the touch area in a specific historical event from a directional input event (for example, a touch event). 685 686**Since**: 12 687 688**Parameters** 689 690| Name| Description| 691| -------- | -------- | 692| event | Pointer to the UI input event. | 693| pointerIndex | Index of the target touch point in the multi-touch data list. | 694| historyIndex | Index of the target historical event. | 695 696**Returns** 697 698Returns the height of the touch area. 699 700 701### OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth() 702 703``` 704float OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 705``` 706**Description** 707 708Obtains the width of the touch area in a specific historical event from a directional input event (for example, a touch event). 709 710**Since**: 12 711 712**Parameters** 713 714| Name| Description| 715| -------- | -------- | 716| event | Pointer to the UI input event. | 717| pointerIndex | Index of the target touch point in the multi-touch data list. | 718| historyIndex | Index of the target historical event. | 719 720**Returns** 721 722Returns the width of the touch area. 723 724 725### OH_ArkUI_PointerEvent_GetHistoryWindowX() 726 727``` 728float OH_ArkUI_PointerEvent_GetHistoryWindowX (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 729``` 730**Description** 731 732Obtains the X-coordinate of a specific touch point in a historical event relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). 733 734**Since**: 12 735 736**Parameters** 737 738| Name| Description| 739| -------- | -------- | 740| event | Pointer to the UI input event. | 741| pointerIndex | Index of the target touch point in the multi-touch data list. | 742| historyIndex | Index of the target historical event. | 743 744**Returns** 745 746Returns the X-coordinate relative to the upper left corner of the current application window; returns **0.0f** if any parameter error occurs. 747 748 749### OH_ArkUI_PointerEvent_GetHistoryWindowY() 750 751``` 752float OH_ArkUI_PointerEvent_GetHistoryWindowY (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 753``` 754**Description** 755 756Obtains the Y-coordinate of a specific touch point in a historical event relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). 757 758**Since**: 12 759 760**Parameters** 761 762| Name| Description| 763| -------- | -------- | 764| event | Pointer to the UI input event. | 765| pointerIndex | Index of the target touch point in the multi-touch data list. | 766| historyIndex | Index of the target historical event. | 767 768**Returns** 769 770Returns the Y-coordinate relative to the upper left corner of the current application window; returns **0.0f** if any parameter error occurs. 771 772 773### OH_ArkUI_PointerEvent_GetHistoryX() 774 775``` 776float OH_ArkUI_PointerEvent_GetHistoryX (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 777``` 778**Description** 779 780Obtains the X-coordinate of a specific touch point in a historical event relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). 781 782**Since**: 12 783 784**Parameters** 785 786| Name| Description| 787| -------- | -------- | 788| event | Pointer to the UI input event. | 789| pointerIndex | Index of the target touch point in the multi-touch data list. | 790| historyIndex | Index of the target historical event. | 791 792**Returns** 793 794Returns the X-coordinate relative to the upper left corner of the current component; returns **0.0f** if any parameter error occurs. 795 796 797### OH_ArkUI_PointerEvent_GetHistoryY() 798 799``` 800float OH_ArkUI_PointerEvent_GetHistoryY (const ArkUI_UIInputEvent * event, uint32_t pointerIndex, uint32_t historyIndex ) 801``` 802**Description** 803 804Obtains the Y-coordinate of a specific touch point in a historical event relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). 805 806**Since**: 12 807 808**Parameters** 809 810| Name| Description| 811| -------- | -------- | 812| event | Pointer to the UI input event. | 813| pointerIndex | Index of the target touch point in the multi-touch data list. | 814| historyIndex | Index of the target historical event. | 815 816**Returns** 817 818Returns the Y-coordinate relative to the upper left corner of the current component; returns **0.0f** if any parameter error occurs. 819 820 821### OH_ArkUI_PointerEvent_GetPointerCount() 822 823``` 824uint32_t OH_ArkUI_PointerEvent_GetPointerCount (const ArkUI_UIInputEvent * event) 825``` 826**Description** 827 828Obtains the number of touch points from a directional input event (such as a touch event, mouse event, or axis event). 829 830**Since**: 12 831 832**Parameters** 833 834| Name| Description| 835| -------- | -------- | 836| event | Pointer to the UI input event. | 837 838**Returns** 839 840Returns the number of touch points for the directional input event. 841 842 843### OH_ArkUI_PointerEvent_GetPointerId() 844 845``` 846int32_t OH_ArkUI_PointerEvent_GetPointerId (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 847``` 848**Description** 849 850Obtains the ID of a touch point from a directional input event (such as a touch event, mouse event, or axis event). 851 852**Since**: 12 853 854**Parameters** 855 856| Name| Description| 857| -------- | -------- | 858| event | Pointer to the UI input event. | 859| pointerIndex | Index of the target touch point in the multi-touch data list. | 860 861**Returns** 862 863Returns the ID of the corresponding touch point. 864 865 866### OH_ArkUI_PointerEvent_GetPressure() 867 868``` 869float OH_ArkUI_PointerEvent_GetPressure (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 870``` 871**Description** 872 873Obtains the pressure applied to the touchscreen from a directional input event (for example, a touch event). 874 875**Since**: 12 876 877**Parameters** 878 879| Name| Description| 880| -------- | -------- | 881| event | Pointer to the UI input event. | 882| pointerIndex | Index of the target touch point in the multi-touch data list. | 883 884**Returns** 885 886Returns the pressure applied to the touchscreen; returns **0.0f** if any parameter error occurs. 887 888 889### OH_ArkUI_PointerEvent_GetTiltX() 890 891``` 892float OH_ArkUI_PointerEvent_GetTiltX (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 893``` 894**Description** 895 896Obtains the angle relative to the YZ plane from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a rightward tilt. 897 898**Since**: 12 899 900**Parameters** 901 902| Name| Description| 903| -------- | -------- | 904| event | Pointer to the UI input event. | 905| pointerIndex | Index of the target touch point in the multi-touch data list. | 906 907**Returns** 908 909Returns the angle relative to the YZ plane. 910 911 912### OH_ArkUI_PointerEvent_GetTiltY() 913 914``` 915float OH_ArkUI_PointerEvent_GetTiltY (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 916``` 917**Description** 918 919Obtains the angle relative to the XZ plane from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a downward tilt. 920 921**Since**: 12 922 923**Parameters** 924 925| Name| Description| 926| -------- | -------- | 927| event | Pointer to the UI input event. | 928| pointerIndex | Index of the target touch point in the multi-touch data list. | 929 930**Returns** 931 932Returns the angle relative to the XZ plane. 933 934 935### OH_ArkUI_PointerEvent_GetTouchAreaHeight() 936 937``` 938float OH_ArkUI_PointerEvent_GetTouchAreaHeight (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 939``` 940**Description** 941 942Obtains the height of the touch area from a directional input event (for example, a touch event). 943 944**Since**: 12 945 946**Parameters** 947 948| Name| Description| 949| -------- | -------- | 950| event | Pointer to the UI input event. | 951| pointerIndex | Index of the target touch point in the multi-touch data list. | 952 953**Returns** 954 955Returns the height of the touch area. 956 957 958### OH_ArkUI_PointerEvent_GetTouchAreaWidth() 959 960``` 961float OH_ArkUI_PointerEvent_GetTouchAreaWidth (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 962``` 963**Description** 964 965Obtains the width of the touch area from a directional input event (for example, a touch event). 966 967**Since**: 12 968 969**Parameters** 970 971| Name| Description| 972| -------- | -------- | 973| event | Pointer to the UI input event. | 974| pointerIndex | Index of the target touch point in the multi-touch data list. | 975 976**Returns** 977 978Returns the width of the touch area. 979 980 981### OH_ArkUI_PointerEvent_GetWindowX() 982 983``` 984float OH_ArkUI_PointerEvent_GetWindowX (const ArkUI_UIInputEvent * event) 985``` 986**Description** 987 988Obtains the X-coordinate relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). 989 990**Since**: 12 991 992**Parameters** 993 994| Name| Description| 995| -------- | -------- | 996| event | Pointer to the UI input event. | 997 998**Returns** 999 1000Returns the X-coordinate relative to the upper left corner of the current application window; returns **0.0f** if any parameter error occurs. 1001 1002 1003### OH_ArkUI_PointerEvent_GetWindowXByIndex() 1004 1005``` 1006float OH_ArkUI_PointerEvent_GetWindowXByIndex (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 1007``` 1008**Description** 1009 1010Obtains the X-coordinate of a specific touch point relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). 1011 1012**Since**: 12 1013 1014**Parameters** 1015 1016| Name| Description| 1017| -------- | -------- | 1018| event | Pointer to the UI input event. | 1019| pointerIndex | Index of the target touch point in the multi-touch data list. | 1020 1021**Returns** 1022 1023Returns the X-coordinate relative to the upper left corner of the current application window; returns **0.0f** if any parameter error occurs. 1024 1025 1026### OH_ArkUI_PointerEvent_GetWindowY() 1027 1028``` 1029float OH_ArkUI_PointerEvent_GetWindowY (const ArkUI_UIInputEvent * event) 1030``` 1031**Description** 1032 1033Obtains the Y-coordinate relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). 1034 1035**Since**: 12 1036 1037**Parameters** 1038 1039| Name| Description| 1040| -------- | -------- | 1041| event | Pointer to the UI input event. | 1042 1043**Returns** 1044 1045Returns the Y-coordinate relative to the upper left corner of the current application window; returns **0.0f** if any parameter error occurs. 1046 1047 1048### OH_ArkUI_PointerEvent_GetWindowYByIndex() 1049 1050``` 1051float OH_ArkUI_PointerEvent_GetWindowYByIndex (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 1052``` 1053**Description** 1054 1055Obtains the Y-coordinate of a specific touch point relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). 1056 1057**Since**: 12 1058 1059**Parameters** 1060 1061| Name| Description| 1062| -------- | -------- | 1063| event | Pointer to the UI input event. | 1064| pointerIndex | Index of the target touch point in the multi-touch data list. | 1065 1066**Returns** 1067 1068Returns the Y-coordinate relative to the upper left corner of the current application window; returns **0.0f** if any parameter error occurs. 1069 1070 1071### OH_ArkUI_PointerEvent_GetX() 1072 1073``` 1074float OH_ArkUI_PointerEvent_GetX (const ArkUI_UIInputEvent * event) 1075``` 1076**Description** 1077 1078Obtains the X-coordinate relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). 1079 1080**Since**: 12 1081 1082**Parameters** 1083 1084| Name| Description| 1085| -------- | -------- | 1086| event | Pointer to the UI input event. | 1087 1088**Returns** 1089 1090Returns the X-coordinate relative to the upper left corner of the current component; returns **0.0f** if any parameter error occurs. 1091 1092 1093### OH_ArkUI_PointerEvent_GetXByIndex() 1094 1095``` 1096float OH_ArkUI_PointerEvent_GetXByIndex (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 1097``` 1098**Description** 1099 1100Obtains the X-coordinate of a specific touch point relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). 1101 1102**Since**: 12 1103 1104**Parameters** 1105 1106| Name| Description| 1107| -------- | -------- | 1108| event | Pointer to the UI input event. | 1109| pointerIndex | Index of the target touch point in the multi-touch data list. | 1110 1111**Returns** 1112 1113Returns the X-coordinate relative to the upper left corner of the current component; returns **0.0f** if any parameter error occurs. 1114 1115 1116### OH_ArkUI_PointerEvent_GetY() 1117 1118``` 1119float OH_ArkUI_PointerEvent_GetY (const ArkUI_UIInputEvent * event) 1120``` 1121**Description** 1122 1123Obtains the Y-coordinate relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). 1124 1125**Since**: 12 1126 1127**Parameters** 1128 1129| Name| Description| 1130| -------- | -------- | 1131| event | Pointer to the UI input event. | 1132 1133**Returns** 1134 1135Returns the Y-coordinate relative to the upper left corner of the current component; returns **0.0f** if any parameter error occurs. 1136 1137 1138### OH_ArkUI_PointerEvent_GetYByIndex() 1139 1140``` 1141float OH_ArkUI_PointerEvent_GetYByIndex (const ArkUI_UIInputEvent * event, uint32_t pointerIndex ) 1142``` 1143**Description** 1144 1145Obtains the Y-coordinate of a specific touch point relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). 1146 1147**Since**: 12 1148 1149**Parameters** 1150 1151| Name| Description| 1152| -------- | -------- | 1153| event | Pointer to the UI input event. | 1154| pointerIndex | Index of the target touch point in the multi-touch data list. | 1155 1156**Returns** 1157 1158Returns the Y-coordinate relative to the upper left corner of the current component; returns **0.0f** if any parameter error occurs. 1159 1160 1161### OH_ArkUI_PointerEvent_SetInterceptHitTestMode() 1162 1163``` 1164int32_t OH_ArkUI_PointerEvent_SetInterceptHitTestMode (const ArkUI_UIInputEvent * event, HitTestMode mode ) 1165``` 1166**Description** 1167 1168Sets how the component behaves during hit testing. 1169 1170**Since**: 12 1171 1172**Parameters** 1173 1174| Name| Description| 1175| -------- | -------- | 1176| event | Pointer to the UI input event. | 1177| mode | How the component behaves during hit testing. The parameter type is [HitTestMode](#hittestmode). | 1178 1179**Returns** 1180 1181Returns the status code of the execution. 1182 1183 1184### OH_ArkUI_PointerEvent_SetStopPropagation() 1185 1186``` 1187int32_t OH_ArkUI_PointerEvent_SetStopPropagation (const ArkUI_UIInputEvent * event, bool stopPropagation ) 1188``` 1189**Description** 1190 1191Sets whether to stop event propagation. 1192 1193**Since**: 12 1194 1195**Parameters** 1196 1197| Name| Description| 1198| -------- | -------- | 1199| event | Pointer to the UI input event. | 1200| stopPropagation | Whether to stop event propagation. | 1201 1202**Returns** 1203 1204Returns the status code of the execution. Returns **0** if the operation is successful; returns **401** if the operation fails, possibly because a parameter error, for example, null pointer for the **event** parameter, occurs. 1205 1206 1207### OH_ArkUI_UIInputEvent_GetAction() 1208 1209``` 1210int32_t OH_ArkUI_UIInputEvent_GetAction (const ArkUI_UIInputEvent * event) 1211``` 1212**Description** 1213 1214Obtains the action type of this UI input event. 1215 1216**Since**: 12 1217 1218**Parameters** 1219 1220| Name| Description| 1221| -------- | -------- | 1222| event | Pointer to the UI input event. | 1223 1224**Returns** 1225 1226Returns the action type of the UI input event; returns **0** if any parameter error occurs. 1227 1228 1229### OH_ArkUI_UIInputEvent_GetEventTime() 1230 1231``` 1232int64_t OH_ArkUI_UIInputEvent_GetEventTime (const ArkUI_UIInputEvent * event) 1233``` 1234**Description** 1235 1236Obtains the time when a specified UI input event occurs. 1237 1238**Since**: 12 1239 1240**Parameters** 1241 1242| Name| Description| 1243| -------- | -------- | 1244| event | Pointer to the UI input event. | 1245 1246**Returns** 1247 1248Returns the time when the UI input event occurs; returns **0** if any parameter error occurs. 1249 1250 1251### OH_ArkUI_UIInputEvent_GetSourceType() 1252 1253``` 1254int32_t OH_ArkUI_UIInputEvent_GetSourceType (const ArkUI_UIInputEvent * event) 1255``` 1256**Description** 1257 1258Obtains the source type of a UI input event. 1259 1260**Since**: 12 1261 1262**Parameters** 1263 1264| Name| Description| 1265| -------- | -------- | 1266| event | Pointer to the UI input event. | 1267 1268**Returns** 1269 1270Returns the source type of the UI input event. 1271 1272 1273### OH_ArkUI_UIInputEvent_GetToolType() 1274 1275``` 1276int32_t OH_ArkUI_UIInputEvent_GetToolType (const ArkUI_UIInputEvent * event) 1277``` 1278**Description** 1279 1280Obtains the tool type of a UI input event. 1281 1282**Since**: 12 1283 1284**Parameters** 1285 1286| Name| Description| 1287| -------- | -------- | 1288| event | Pointer to the UI input event. | 1289 1290**Returns** 1291 1292Returns the tool type of the UI input event. 1293 1294 1295### OH_ArkUI_UIInputEvent_GetType() 1296 1297``` 1298int32_t OH_ArkUI_UIInputEvent_GetType (const ArkUI_UIInputEvent * event) 1299``` 1300**Description** 1301 1302Obtains the type of a UI input event. 1303 1304**Since**: 12 1305 1306**Parameters** 1307 1308| Name| Description| 1309| -------- | -------- | 1310| event | Pointer to the UI input event. | 1311 1312**Returns** 1313 1314Returns the type of the UI input event; returns **0** if any parameter error occurs. 1315