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:
ma-shaoyin
2022-07-20 12:56:11 +08:00
parent 5cc2861a8f
commit 7b28874656
2 changed files with 28 additions and 0 deletions
@@ -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);
}