diff --git a/frameworks/core/components/text_field/on_text_changed_listener_impl.cpp b/frameworks/core/components/text_field/on_text_changed_listener_impl.cpp index ada988cdc1304ad21bde679766d2c1796f812e9d..c26c2454ee5a16de99b41b082aff9f2db5914ea4 100644 --- a/frameworks/core/components/text_field/on_text_changed_listener_impl.cpp +++ b/frameworks/core/components/text_field/on_text_changed_listener_impl.cpp @@ -129,10 +129,14 @@ void OnTextChangedListenerImpl::SetKeyboardStatus(bool status) void OnTextChangedListenerImpl::SendKeyEventFromInputMethod(const MiscServices::KeyEvent& event) {} -void OnTextChangedListenerImpl::SendKeyboardInfo(const MiscServices::KeyboardInfo& info) +void OnTextChangedListenerImpl::SendKeyboardStatus(const MiscServices::KeyboardStatus& keyboardStatus) { - HandleKeyboardStatus(info.GetKeyboardStatus()); - HandleFunctionKey(info.GetFunctionKey()); + HandleKeyboardStatus(keyboardStatus); +} + +void OnTextChangedListenerImpl::SendFunctionKey(const MiscServices::FunctionKey& functionKey) +{ + HandleFunctionKey(functionKey); } void OnTextChangedListenerImpl::HandleKeyboardStatus(MiscServices::KeyboardStatus status) @@ -153,7 +157,7 @@ void OnTextChangedListenerImpl::HandleFunctionKey(MiscServices::FunctionKey func return; } ContainerScope scope(client->instanceId_); - TextInputAction action_ = static_cast(functionKey); + TextInputAction action_ = static_cast(functionKey.GetEnterKeyType()); switch (action_) { case TextInputAction::DONE: case TextInputAction::NEXT: diff --git a/frameworks/core/components/text_field/on_text_changed_listener_impl.h b/frameworks/core/components/text_field/on_text_changed_listener_impl.h index 8af6cc5ac6868fdd27aa7a53900f32e23baf7adb..ed76ab1c18a8e9253ab5e8772fb13c71b615c0af 100644 --- a/frameworks/core/components/text_field/on_text_changed_listener_impl.h +++ b/frameworks/core/components/text_field/on_text_changed_listener_impl.h @@ -33,7 +33,8 @@ public: void DeleteForward(int32_t length) override; void SetKeyboardStatus(bool status) override; void SendKeyEventFromInputMethod(const MiscServices::KeyEvent& event) override; - void SendKeyboardInfo(const MiscServices::KeyboardInfo& info) override; + void SendKeyboardStatus(const MiscServices::KeyboardStatus& keyboardStatus) override; + void SendFunctionKey(const MiscServices::FunctionKey& functionKey) override; void MoveCursor(MiscServices::Direction direction) override; void HandleSetSelection(int32_t start, int32_t end) override; void HandleExtendAction(int32_t action) override; diff --git a/frameworks/core/components_ng/pattern/text_field/on_text_changed_listener_impl.cpp b/frameworks/core/components_ng/pattern/text_field/on_text_changed_listener_impl.cpp index ba09e4ff25a9b3448407f96bbc2f0706e6387348..7ba3addefc625ed1172fad395ddb0df1a15ac7c7 100644 --- a/frameworks/core/components_ng/pattern/text_field/on_text_changed_listener_impl.cpp +++ b/frameworks/core/components_ng/pattern/text_field/on_text_changed_listener_impl.cpp @@ -81,13 +81,17 @@ void OnTextChangedListenerImpl::SetKeyboardStatus(bool status) void OnTextChangedListenerImpl::SendKeyEventFromInputMethod(const MiscServices::KeyEvent& event) {} -void OnTextChangedListenerImpl::SendKeyboardInfo(const MiscServices::KeyboardInfo& info) +void OnTextChangedListenerImpl::SendKeyboardStatus(const MiscServices::KeyboardStatus& keyboardStatus) { - LOGI("[OnTextChangedListenerImpl] KeyboardStatus status: %{public}d", info.GetKeyboardStatus()); + LOGI("[OnTextChangedListenerImpl] SendKeyboardStatus status: %{public}d", static_cast(keyboardStatus)); // this keyboard status means shown or hidden but attachment is not closed, should be distinguished from // imeAttached_ - HandleKeyboardStatus(info.GetKeyboardStatus()); - HandleFunctionKey(info.GetFunctionKey()); + HandleKeyboardStatus(keyboardStatus); +} + +void OnTextChangedListenerImpl::SendFunctionKey(const MiscServices::FunctionKey& functionKey) +{ + HandleFunctionKey(functionKey); } void OnTextChangedListenerImpl::HandleKeyboardStatus(MiscServices::KeyboardStatus status) @@ -101,12 +105,13 @@ void OnTextChangedListenerImpl::HandleKeyboardStatus(MiscServices::KeyboardStatu void OnTextChangedListenerImpl::HandleFunctionKey(MiscServices::FunctionKey functionKey) { - LOGI("[OnTextChangedListenerImpl] Handle function key %{public}d", static_cast(functionKey)); + LOGI("[OnTextChangedListenerImpl] Handle function key %{public}d", + static_cast(functionKey.GetEnterKeyType())); auto task = [textField = pattern_, functionKey] { auto client = textField.Upgrade(); CHECK_NULL_VOID(client); ContainerScope scope(client->GetInstanceId()); - TextInputAction action = static_cast(functionKey); + TextInputAction action = static_cast(functionKey.GetEnterKeyType()); switch (action) { case TextInputAction::DONE: case TextInputAction::NEXT: diff --git a/frameworks/core/components_ng/pattern/text_field/on_text_changed_listener_impl.h b/frameworks/core/components_ng/pattern/text_field/on_text_changed_listener_impl.h index 6038cf6302d203251f0acff9a1bcc0013d106824..ae840a2aa9040b8a71f3bb9565fc9e1846d10369 100644 --- a/frameworks/core/components_ng/pattern/text_field/on_text_changed_listener_impl.h +++ b/frameworks/core/components_ng/pattern/text_field/on_text_changed_listener_impl.h @@ -32,7 +32,8 @@ public: void DeleteForward(int32_t length) override; void SetKeyboardStatus(bool status) override; void SendKeyEventFromInputMethod(const MiscServices::KeyEvent& event) override; - void SendKeyboardInfo(const MiscServices::KeyboardInfo& info) override; + void SendKeyboardStatus(const MiscServices::KeyboardStatus& keyboardStatus) override; + void SendFunctionKey(const MiscServices::FunctionKey& functionKey) override; void MoveCursor(MiscServices::Direction direction) override; void HandleSetSelection(int32_t start, int32_t end) override; void HandleExtendAction(int32_t action) override;