提交 02d0fb97 编写于 作者: M mayunteng_1

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

Signed-off-by: Nmayunteng_1 <mayunteng@huawei.com>
Change-Id: Ibacd4ad71891f676bb5833eb07a2528b25bd76d3
上级 afe9cedf
......@@ -40,8 +40,8 @@ try {
// 1.获取设备列表,判断是否有物理键盘连接
inputDevice.getDeviceList().then(data => {
for (let i = 0; i < data.length; ++i) {
inputDevice.getKeyboardType(data[i]).then(res => {
if (type == inputDevice.KeyboardType.ALPHABETIC_KEYBOARD) {
inputDevice.getKeyboardType(data[i]).then(type => {
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') {
......
......@@ -7,7 +7,7 @@
## 导入模块
```js
import inputDevice from '@ohos.multimodalInput.pointer';
import pointer from '@ohos.multimodalInput.pointer';
```
## 接口说明
......
......@@ -9,7 +9,7 @@
## 导入模块
```js
import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mouseEvent';
import { Action, Button, Axis, AxisValue, MouseEvent } from '@ohos.multimodalInput.mouseEvent';
```
## Action
......
......@@ -276,7 +276,7 @@ import window from '@ohos.window';
window.getTopWindow((error, win) => {
win.getProperties((error, properties) => {
var windowId = properties.id;
let windowId = properties.id;
if (windowId < 0) {
console.log(`Invalid windowId`);
return;
......@@ -319,7 +319,7 @@ import window from '@ohos.window';
window.getTopWindow((error, win) => {
win.getProperties((error, properties) => {
var windowId = properties.id;
let windowId = properties.id;
if (windowId < 0) {
console.log(`Invalid windowId`);
return;
......@@ -358,7 +358,7 @@ import window from '@ohos.window';
window.getTopWindow((error, win) => {
win.getProperties((error, properties) => {
var windowId = properties.id;
let windowId = properties.id;
if (windowId < 0) {
console.log(`Invalid windowId`);
return;
......@@ -396,7 +396,7 @@ import window from '@ohos.window';
window.getTopWindow((error, win) => {
win.getProperties((error, properties) => {
var windowId = properties.id;
let windowId = properties.id;
if (windowId < 0) {
console.log(`Invalid windowId`);
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册