合入硬键盘按键功能

Signed-off-by: zhouyongfei <zhouyongfei@huawei.com>
This commit is contained in:
zhouyongfei
2022-01-19 17:42:48 +08:00
parent 0f2e822dd5
commit b79974a975
11 changed files with 80 additions and 8 deletions
+20
View File
@@ -152,6 +152,10 @@ namespace MiscServices {
OnStopInput(msg);
break;
}
case MSG_ID_DISPATCH_KEY: {
DispatchKey(msg);
break;
}
case MSG_ID_SET_INPUT_METHOD_CORE: {
onSetInputMethodCore(msg);
break;
@@ -1338,5 +1342,21 @@ namespace MiscServices {
IMSA_HILOGI("PerUserSession::OnStopInput End...[%{public}d]\n", userId_);
}
}
void PerUserSession::DispatchKey(Message *msg)
{
IMSA_HILOGI("PerUserSession::DispatchKey");
MessageParcel *data = msg->msgContent_;
sptr<IRemoteObject> clientObject = data->ReadRemoteObject();
int32_t keyCode = data->ReadInt32();
int32_t state = data->ReadInt32();
if (localControlChannel[currentIndex]->GetAgentAndChannel(&imsAgent, &imsChannel) == true) {
IMSA_HILOGI("PerUserSession::DispatchKey GetAgentAndChannel");
sptr<InputMethodAgentProxy> agent = new InputMethodAgentProxy(imsAgent->AsObject().GetRefPtr());
agent->DispatchKey(keyCode,state);
}
}
}
}