diff --git a/zh-cn/application-dev/device/inputdevice-guidelines.md b/zh-cn/application-dev/device/inputdevice-guidelines.md index d7aaf54eec4457c45bcf9d10a23d512cde768a29..d08fbacfef9c363dfb8b4c206008b05793e5434e 100644 --- a/zh-cn/application-dev/device/inputdevice-guidelines.md +++ b/zh-cn/application-dev/device/inputdevice-guidelines.md @@ -41,7 +41,7 @@ try { inputDevice.getDeviceList().then(data => { for (let i = 0; i < data.length; ++i) { inputDevice.getKeyboardType(data[i]).then(type => { - if (type == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD) { + if (type === inputDevice.KeyboardType.ALPHABETIC_KEYBOARD) { // 物理键盘已连接 isPhysicalKeyboardExist = true; } @@ -53,7 +53,7 @@ try { console.log(`Device event info: ${JSON.stringify(data)}`); inputDevice.getKeyboardType(data.deviceId, (error, type) => { console.log("The keyboard type is: " + type); - if (type == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'add') { + if (type === inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'add') { // 物理键盘已插入 isPhysicalKeyboardExist = true; } else if (type == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'remove') {