diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md index 80af951e3c3ce1fb6ef0501f32acc68dff09e4fb..564444daffe89d2300a83a415af4de76bc7b47a7 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md @@ -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; } @@ -382,4 +382,4 @@ inputDevice.getKeyboardType().then((ret)=>{ | ALPHABETIC_KEYBOARD | number | 2 | 表示全键盘设备。 | | DIGITAL_KEYBOARD | number | 3 | 表示小键盘设备。 | | HANDWRITING_PEN | number | 4 | 表示手写笔设备。 | -| REMOTE_CONTROL | number | 5 | 表示遥控器设备。 | \ No newline at end of file +| REMOTE_CONTROL | number | 5 | 表示遥控器设备。 |