提交 4bfd53e1 编写于 作者: M mayunteng_1

md修改

Signed-off-by: Nmayunteng_1 <mayunteng@huawei.com>
Change-Id: I60fc9db268300de27d338e49fbcb9e29c1e7d55a
上级 978c7be6
......@@ -39,22 +39,11 @@ on(type: "touch", receiver: TouchEventReceiver): void
**示例:**
```js
callback: function (value) {
if (checkEvent(value)) {
//事件满足业务要求,事件被消费
return true;
} else {
//事件不满足业务要求,事件未被消费
return false;
}
},
testOn: function () {
console.info("InputMonitorJsTest---start---testOn");
inputMonitor.on(
"touch",
this.callback
);
console.info("InputMonitorJsTest---end---testOn");
testOn() {
inputMonitor.off("touch", (event) => {
// 消费触屏事件
return false;
});
}
```
......@@ -76,20 +65,10 @@ on(type: "mouse", receiver: TouchEventReceiver): void
**示例:**
```js
callback: function (value) {
if (checkEvent(value)) {
//事件满足业务要求,事件被消费
} else {
//事件不满足业务要求,事件未被消费
}
},
testOn: function () {
console.info("InputMonitorJsTest---start---testOn");
inputMonitor.on(
"mouse",
this.callback
);
console.info("InputMonitorJsTest---end---testOn");
testOn() {
inputMonitor.off("mouse", (event) => {
// 消费鼠标事件
});
}
```
......@@ -114,22 +93,8 @@ off(type: "touch", receiver: TouchEventReceiver): void
**示例:**
```js
callback: function (value) {
if (checkEvent(value)) {
//事件满足业务要求,事件被消费
return true;
} else {
//事件不满足业务要求,事件未被消费
return false;
}
},
testOff: function () {
console.info("InputMonitorJsTest---start---testOff");
inputMonitor.off(
"touch",
this.callback
);
console.info("InputMonitorJsTest---end---testOff");
testOff() {
inputMonitor.off("touch");
}
```
......@@ -143,28 +108,16 @@ off(type: "mouse", receiver?: Callback<MouseEvent>): void
**参数:**
| 参数 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | -------------------------------------- |
| type | string | 是 | 监听输入事件类型,取值“mouse”。 |
| receiver | Callback<MouseEvent> | 否 | 触摸输入事件回调函数。MouseEvent参考xx |
| 参数 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ------------------------------- |
| type | string | 是 | 监听输入事件类型,取值“mouse”。 |
| receiver | Callback<MouseEvent> | 否 | 鼠标输入事件回调函数。 |
**示例:**
```js
callback: function (value) {
if (checkEvent(value)) {
//事件满足业务要求,事件被消费
} else {
//事件不满足业务要求,事件未被消费
}
},
testOff: function () {
console.info("InputMonitorJsTest---start---testOff");
inputMonitor.off(
"touch",
this.callback
);
console.info("InputMonitorJsTest---end---testOff");
testOff() {
inputMonitor.off("mouse");
}
```
......@@ -194,21 +147,11 @@ testOff: function () {
**示例:**
```js
callback: function (value) { //此处为(touchEvent:TouchEvent): Boolean 方法的实现
if (checkEvent(value)) {
//事件满足业务要求,事件被消费
return true;
} else {
//事件不满足业务要求,事件未被消费
return false;
}
},
testOff: function () {
console.info("InputMonitorJsTest---start---testOff");
inputMonitor.off(
"touch",
this.callback
);
console.info("InputMonitorJsTest---end---testOff");
test() {
inputMonitor.on("touch", (event) => {
// 消费触屏事件
return false;
});
inputMonitor.off("touch");
}
```
......@@ -101,7 +101,7 @@ import Axis from '@ohos.multimodalInput.mouseEvent'
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| ----------------- | -------- | ---- | ---- | ------------ |
| SCROLL_VERTICAL | number | 是 | 否 | 鼠标垂直轴。 |
| SCROLL_HORIZONTAL | number | 是 | 否 | 鼠标水平轴 |
| SCROLL_HORIZONTAL | number | 是 | 否 | 鼠标水平轴 |
| PINCH | number | 是 | 否 | 鼠标捏合轴。 |
# AxisValue
......@@ -120,5 +120,5 @@ import AxisValue from '@ohos.multimodalInput.mouseEvent'
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
| ----- | -------- | ---- | ---- | ------------ |
| axis | Axis | 是 | 是 | 鼠标轴类型 |
| axis | Axis | 是 | 是 | 鼠标轴类型 |
| value | number | 是 | 是 | 鼠标轴的值。 |
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册