mirror of
https://github.com/openharmony/miscservices_inputmethod.git
synced 2026-07-19 20:13:32 -04:00
Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>
Changes to be committed: modified: frameworks/inputmethod_controller/src/input_method_controller.cpp
This commit is contained in:
@@ -111,6 +111,8 @@ namespace MiscServices {
|
||||
bool stop_;
|
||||
int32_t enterKeyType_ = 0;
|
||||
int32_t inputPattern_ = 0;
|
||||
|
||||
bool isStopInput {false};
|
||||
};
|
||||
} // namespace MiscServices
|
||||
} // namespace OHOS
|
||||
|
||||
@@ -294,6 +294,7 @@ using namespace MessageID;
|
||||
&& data.WriteRemoteObject(client->AsObject()))) {
|
||||
return;
|
||||
}
|
||||
isStopInput = false;
|
||||
mImms->startInput(data);
|
||||
}
|
||||
|
||||
@@ -308,6 +309,7 @@ using namespace MessageID;
|
||||
&& data.WriteRemoteObject(client->AsObject().GetRefPtr()))) {
|
||||
return;
|
||||
}
|
||||
isStopInput = true;
|
||||
mImms->releaseInput(data);
|
||||
}
|
||||
|
||||
@@ -322,6 +324,7 @@ using namespace MessageID;
|
||||
&& data.WriteRemoteObject(client->AsObject().GetRefPtr()))) {
|
||||
return;
|
||||
}
|
||||
isStopInput = true;
|
||||
mImms->stopInput(data);
|
||||
}
|
||||
|
||||
@@ -347,6 +350,11 @@ using namespace MessageID;
|
||||
return;
|
||||
}
|
||||
|
||||
if (isStopInput == true) {
|
||||
IMSA_HILOGD("InputMethodController::OnCursorUpdate isStopInput is true");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cursorInfo_.left == cursorInfo.left && cursorInfo_.top == cursorInfo.top
|
||||
&& cursorInfo_.height == cursorInfo.height) {
|
||||
return;
|
||||
@@ -371,6 +379,12 @@ using namespace MessageID;
|
||||
IMSA_HILOGI("InputMethodController::OnSelectionChange agent is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
if (isStopInput == true) {
|
||||
IMSA_HILOGD("InputMethodController::OnSelectionChange isStopInput is true");
|
||||
return;
|
||||
}
|
||||
|
||||
agent->OnSelectionChange(mTextString, mSelectOldBegin, mSelectOldEnd, mSelectNewBegin, mSelectNewEnd);
|
||||
}
|
||||
|
||||
@@ -411,6 +425,12 @@ using namespace MessageID;
|
||||
IMSA_HILOGI("InputMethodController::dispatchKeyEvent agent is nullptr");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isStopInput == true) {
|
||||
IMSA_HILOGD("InputMethodController::dispatchKeyEvent isStopInput is true");
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageParcel data;
|
||||
if (!(data.WriteInterfaceToken(agent->GetDescriptor())
|
||||
&& data.WriteInt32(keyEvent->GetKeyCode())
|
||||
@@ -441,6 +461,12 @@ using namespace MessageID;
|
||||
IMSA_HILOGI("InputMethodController::SetCallingWindow agent is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
if (isStopInput == true) {
|
||||
IMSA_HILOGD("InputMethodController::SetCallingWindow isStopInput is true");
|
||||
return;
|
||||
}
|
||||
|
||||
agent->SetCallingWindow(windowId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user