From f95445feb186e5d0405548139a423ba26c9905f2 Mon Sep 17 00:00:00 2001 From: wangweiyuan Date: Wed, 28 May 2025 11:53:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=A0=81=E8=8E=B7=E5=8F=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangweiyuan --- arkui/ace_engine/native/libace.ndk.json | 4 ++++ arkui/ace_engine/native/native_type.h | 5 +++++ arkui/ace_engine/native/ui_input_event.h | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 7a15d4e4f..59e5f3dd4 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 828ba5b7d..0e59ab172 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 b8c6b17d7..fac4d040d 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 -- Gitee