From 760c33f25502983cea6a804cc873c541df4322bc Mon Sep 17 00:00:00 2001 From: wangxiuxiu96 Date: Wed, 6 Nov 2024 14:42:43 +0800 Subject: [PATCH] api fix Signed-off-by: wangxiuxiu96 Change-Id: I8193d5cbdb2d47741690cb21d018e0a8e6347aec --- frameworks/core/interfaces/arkoala/arkoala_api.h | 2 +- .../core/interfaces/native/node/node_common_modifier.cpp | 2 +- interfaces/native/event/key_event_impl.cpp | 4 ++-- interfaces/native/libace.ndk.json | 2 +- interfaces/native/native_key_event.h | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frameworks/core/interfaces/arkoala/arkoala_api.h b/frameworks/core/interfaces/arkoala/arkoala_api.h index 0576114ee2d..77f8bdd91f7 100644 --- a/frameworks/core/interfaces/arkoala/arkoala_api.h +++ b/frameworks/core/interfaces/arkoala/arkoala_api.h @@ -1122,7 +1122,7 @@ struct ArkUIKeyEvent { ArkUI_Uint32 intentionCode; // user input. - bool ret; + bool isConsumed; bool stopPropagation; }; diff --git a/frameworks/core/interfaces/native/node/node_common_modifier.cpp b/frameworks/core/interfaces/native/node/node_common_modifier.cpp index be06a5c23b5..9abf6b11422 100644 --- a/frameworks/core/interfaces/native/node/node_common_modifier.cpp +++ b/frameworks/core/interfaces/native/node/node_common_modifier.cpp @@ -6625,7 +6625,7 @@ void SetOnKeyPreIme(ArkUINodeHandle node, void* extraParam) PipelineContext::SetCallBackNode(AceType::WeakClaim(frameNode)); SendArkUIAsyncEvent(&event); info.SetStopPropagation(event.keyEvent.stopPropagation); - return event.keyEvent.ret; + return event.keyEvent.isConsumed; }; NG::ViewAbstractModelNG::SetOnKeyPreIme(frameNode, std::move(onPreImeEvent)); } diff --git a/interfaces/native/event/key_event_impl.cpp b/interfaces/native/event/key_event_impl.cpp index 2846b56a073..c83ceb4e592 100644 --- a/interfaces/native/event/key_event_impl.cpp +++ b/interfaces/native/event/key_event_impl.cpp @@ -163,7 +163,7 @@ uint32_t OH_ArkUI_KeyEvent_GetUnicode(const ArkUI_UIInputEvent *event) return result; } -void OH_ArkUI_KeyEvent_SetRet(const ArkUI_UIInputEvent *event, bool ret) +void OH_ArkUI_KeyEvent_SetConsumed(const ArkUI_UIInputEvent *event, bool isConsumed) { if (!event) { return; @@ -172,7 +172,7 @@ void OH_ArkUI_KeyEvent_SetRet(const ArkUI_UIInputEvent *event, bool ret) if (!keyEvent) { return; } - keyEvent->ret = ret; + keyEvent->isConsumed = isConsumed; } #ifdef __cplusplus }; diff --git a/interfaces/native/libace.ndk.json b/interfaces/native/libace.ndk.json index c317a33383c..8d0f4c9a8ad 100644 --- a/interfaces/native/libace.ndk.json +++ b/interfaces/native/libace.ndk.json @@ -2437,6 +2437,6 @@ }, { "first_introduced": "14", - "name": "OH_ArkUI_KeyEvent_SetRet" + "name": "OH_ArkUI_KeyEvent_SetConsumed" } ] diff --git a/interfaces/native/native_key_event.h b/interfaces/native/native_key_event.h index c7ea1c9624a..4336a1a296e 100644 --- a/interfaces/native/native_key_event.h +++ b/interfaces/native/native_key_event.h @@ -616,10 +616,10 @@ uint32_t OH_ArkUI_KeyEvent_GetUnicode(const ArkUI_UIInputEvent* event); * @brief 在按键事件回调中,设置事件是否被该回调消费 * * @param event ArkUI_UIInputEvent事件指针。 - * @param ret 是否被消费。 + * @param isConsumed 是否被消费。 * @since 14 */ -void OH_ArkUI_KeyEvent_SetRet(const ArkUI_UIInputEvent* event, bool ret); +void OH_ArkUI_KeyEvent_SetConsumed(const ArkUI_UIInputEvent* event, bool isConsumed); #ifdef __cplusplus }; #endif