diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index dc3d30be4c1491c195b569a958e86367b7945d40..482059acf88181174e734d7f00484ff7415a7dc9 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -171,6 +171,10 @@ "first_introduced": "15", "name": "OH_ArkUI_AxisEvent_GetAxisAction" }, + { + "first_introduced": "21", + "name": "OH_ArkUI_AxisEvent_HasAxis" + }, { "first_introduced": "12", "name": "OH_ArkUI_GetNodeHandleFromNapiValue" diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index 1e74a9ff75b05a103684fc1f90528b8fa5b5a80c..1e567eacf6ce53b9d51b9283946fb4d6cefbf31e 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -247,6 +247,20 @@ enum { UI_FOCUS_AXIS_EVENT_ABS_HAT0Y = 7, }; +/** + * @brief Defines an enum for the axis types for axis events. + * + * @since 21 + */ +enum { + /** Vertical scroll axis. */ + UI_AXIS_TYPE_VERTICAL_AXIS = 0, + /** Horizontal scroll axis. */ + UI_AXIS_TYPE_HORIZONTAL_AXIS = 1, + /** Pinch axis. */ + UI_AXIS_TYPE_PINCH_AXIS = 2, +}; + /** * @brief Defines whether the touch event is from the left or right hand. * @@ -994,6 +1008,16 @@ double OH_ArkUI_AxisEvent_GetPinchAxisScaleValue(const ArkUI_UIInputEvent* event */ int32_t OH_ArkUI_AxisEvent_GetAxisAction(const ArkUI_UIInputEvent* event); +/** + * @brief Checks whether this event contains a specified axis type. + * + * @param event Indicates the pointer to the current UI input event. + * @param axis Axis type of the axis event. + * @return Returns true if the event contains the specified axis type; returns false otherwise. + * @since 21 + */ +int32_t OH_ArkUI_AxisEvent_HasAxis(const ArkUI_UIInputEvent* event, int32_t axis); + /** * @brief Sets the hit testing mode, that is, how the component behaves during hit testing. * This API only applies to scenarios raw input events are received, such as when {@link NODE_ON_TOUCH} is used for