diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 3c739a283d083bc3ec54e71cbce89094a70bce10..b9e75ed957502a3e7086610d4da375b774fbfedb 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 a13728fe50da5166a9e103e72b83ea0ff757db7d..2e1ca6407543caefac24e6d05aae5ef8b005cfd6 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -37,6 +37,7 @@ #define _ARKUI_UI_INPUT_EVENT_H_ #include "native_type.h" +#include #include #ifdef __cplusplus @@ -247,6 +248,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. * @@ -992,6 +1007,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