未验证 提交 c91373f5 编写于 作者: O openharmony_ci 提交者: Gitee

!4869 多模示例修改

Merge pull request !4869 from mayunteng/myt
......@@ -38,10 +38,10 @@ inputDevice.on("change", (data) => {
console.log("type: " + data.type + ", deviceId: " + data.deviceId);
inputDevice.getKeyboardType(data.deviceId, (ret) => {
console.log("The keyboard type of the device is: " + ret);
if (ret == 2 && data.type == 'add') {
if (ret == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'add') {
// 监听物理键盘已连接。
isPhysicalKeyboardExist = true;
} else if (ret == 2 && data.type == 'remove') {
} else if (ret == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'remove') {
// 监听物理键盘已断开。
isPhysicalKeyboardExist = false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册