From 9c832bea544dcca62ce74792481243c14e8275a4 Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Mon, 30 May 2022 17:55:36 +0800 Subject: [PATCH] =?UTF-8?q?readme=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mayunteng_1 Change-Id: I185afd73189123c52d60136fee92734fbbe21747 --- .../application-dev/reference/apis/js-apis-inputdevice.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 a127eda9cd..80af951e3c 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md @@ -33,11 +33,11 @@ on(type: “change”, listener: Callback<DeviceListener>): void **示例:** ```js -let isPhysicalKeyboardExist = false; -inputDevice.on("change", (data)=>{ +let isPhysicalKeyboardExist = true; +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); + console.log("The keyboard type of the device is: " + ret); if (ret == 2 && data.type == 'add') { // 监听物理键盘已连接。 isPhysicalKeyboardExist = true; @@ -77,6 +77,7 @@ inputDevice.off("change", this.listener); // 取消所有监听 inputDevice.off("change"); +// 取消监听后,软键盘默认都弹出 ``` ## inputDevice.getDeviceIds -- GitLab