提交 15c82fd9 编写于 作者: M mayunteng_1

示例修改

Signed-off-by: Nmayunteng_1 <mayunteng@huawei.com>
Change-Id: I05aa490ed79cb622b340a60020d84513c42f4200
上级 5f0f4944
......@@ -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 == KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'add') {
if (ret == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'add') {
// 监听物理键盘已连接。
isPhysicalKeyboardExist = true;
} else if (ret == KeyboardType.ALPHABETIC_KEYBOARD && 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.
先完成此消息的编辑!
想要评论请 注册