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

!12868 【多模子系统】接口文档及指南修改

Merge pull request !12868 from mayunteng/master
...@@ -40,8 +40,8 @@ try { ...@@ -40,8 +40,8 @@ try {
// 1.获取设备列表,判断是否有物理键盘连接 // 1.获取设备列表,判断是否有物理键盘连接
inputDevice.getDeviceList().then(data => { inputDevice.getDeviceList().then(data => {
for (let i = 0; i < data.length; ++i) { for (let i = 0; i < data.length; ++i) {
inputDevice.getKeyboardType(data[i]).then(res => { inputDevice.getKeyboardType(data[i]).then(type => {
if (type == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD) { if (type === inputDevice.KeyboardType.ALPHABETIC_KEYBOARD) {
// 物理键盘已连接 // 物理键盘已连接
isPhysicalKeyboardExist = true; isPhysicalKeyboardExist = true;
} }
...@@ -53,7 +53,7 @@ try { ...@@ -53,7 +53,7 @@ try {
console.log(`Device event info: ${JSON.stringify(data)}`); console.log(`Device event info: ${JSON.stringify(data)}`);
inputDevice.getKeyboardType(data.deviceId, (error, type) => { inputDevice.getKeyboardType(data.deviceId, (error, type) => {
console.log("The keyboard type is: " + 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; isPhysicalKeyboardExist = true;
} else if (type == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'remove') { } else if (type == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD && data.type == 'remove') {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
## 导入模块 ## 导入模块
```js ```js
import inputDevice from '@ohos.multimodalInput.pointer'; import pointer from '@ohos.multimodalInput.pointer';
``` ```
## 接口说明 ## 接口说明
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
## 导入模块 ## 导入模块
```js ```js
import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mouseEvent'; import { Action, Button, Axis, AxisValue, MouseEvent } from '@ohos.multimodalInput.mouseEvent';
``` ```
## Action ## Action
......
...@@ -276,7 +276,7 @@ import window from '@ohos.window'; ...@@ -276,7 +276,7 @@ import window from '@ohos.window';
window.getTopWindow((error, win) => { window.getTopWindow((error, win) => {
win.getProperties((error, properties) => { win.getProperties((error, properties) => {
var windowId = properties.id; let windowId = properties.id;
if (windowId < 0) { if (windowId < 0) {
console.log(`Invalid windowId`); console.log(`Invalid windowId`);
return; return;
...@@ -319,7 +319,7 @@ import window from '@ohos.window'; ...@@ -319,7 +319,7 @@ import window from '@ohos.window';
window.getTopWindow((error, win) => { window.getTopWindow((error, win) => {
win.getProperties((error, properties) => { win.getProperties((error, properties) => {
var windowId = properties.id; let windowId = properties.id;
if (windowId < 0) { if (windowId < 0) {
console.log(`Invalid windowId`); console.log(`Invalid windowId`);
return; return;
...@@ -358,7 +358,7 @@ import window from '@ohos.window'; ...@@ -358,7 +358,7 @@ import window from '@ohos.window';
window.getTopWindow((error, win) => { window.getTopWindow((error, win) => {
win.getProperties((error, properties) => { win.getProperties((error, properties) => {
var windowId = properties.id; let windowId = properties.id;
if (windowId < 0) { if (windowId < 0) {
console.log(`Invalid windowId`); console.log(`Invalid windowId`);
return; return;
...@@ -396,7 +396,7 @@ import window from '@ohos.window'; ...@@ -396,7 +396,7 @@ import window from '@ohos.window';
window.getTopWindow((error, win) => { window.getTopWindow((error, win) => {
win.getProperties((error, properties) => { win.getProperties((error, properties) => {
var windowId = properties.id; let windowId = properties.id;
if (windowId < 0) { if (windowId < 0) {
console.log(`Invalid windowId`); console.log(`Invalid windowId`);
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册