diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 7a15d4e4f25e8fad68814e6c38199ed4a42e7213..59e5f3dd434b51617684f17265d595a7922bdba3 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3426,5 +3426,9 @@ { "first_introduced": "20", "name": "OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_UIInputEvent_GetLatestStatus" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 828ba5b7d30727b121c7536c4bc4bf9731f6fec9..0e59ab172ed60f1e92111604f13840d838a2dd02 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2263,6 +2263,11 @@ typedef enum { * @since 15 */ ARKUI_ERROR_CODE_POST_CLONED_NO_COMPONENT_HIT_TO_RESPOND_TO_THE_EVENT = 180005, + /** + * @error Input event type not supported. + * @since 20 + */ + ARKUI_ERROR_INPUT_EVENT_TYPE_NOT_SUPPORTED = 180006, /** * @error invalid styled string. * @since 14 diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index b8c6b17d73aad0a599b1da75cabc6a6f1c43ee8f..fac4d040d1a31ca20eb17f5dc256ca37526d3917 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -1272,6 +1272,25 @@ int32_t OH_ArkUI_PointerEvent_SetClonedEventFingerIdByIndex( */ int32_t OH_ArkUI_PointerEvent_PostClonedEvent(ArkUI_NodeHandle node, const ArkUI_UIInputEvent* event); +/** + * @brief Use this method to obtain the execution status of the latest UI input related method. + * + * In most cases, this method is unnecessary unless you need to determine if the return value indicates an error. + * Here's an example of usage: For return values like float (where 0.0 doesn't indicate an error), use GetLatestStatus + * to confirm if an error occurred. + * float x = OH_ArkUI_PointerEvent_GetX(event); + * if (ARKUI_ERROR_CODE_NO_ERROR != OH_ArkUI_UIInputEvent_GetLatestStatus()) { + * // error + * return; + * } + * Note: The system clears the status of the previous function call each time a UIInput-related function is executed, + * ensuring you always get the latest status. + * + * @return Returns the ArkUI_ErrorCode. + * @since 20 + */ +ArkUI_ErrorCode OH_ArkUI_UIInputEvent_GetLatestStatus(); + #ifdef __cplusplus }; #endif