提交 978c7be6 编写于 作者: M mayunteng_1

inputmonitor 资料补齐

Signed-off-by: Nmayunteng_1 <mayunteng@huawei.com>
Change-Id: Ia675f675edce5322ff7376939b572250531cd3b6
上级 d10419b8
......@@ -39,8 +39,7 @@ on(type: "touch", receiver: TouchEventReceiver): void
**示例:**
```js
export default {
callback: function (value) {
callback: function (value) {
if (checkEvent(value)) {
//事件满足业务要求,事件被消费
return true;
......@@ -48,15 +47,14 @@ export default {
//事件不满足业务要求,事件未被消费
return false;
}
},
testOn: function () {
},
testOn: function () {
console.info("InputMonitorJsTest---start---testOn");
inputMonitor.on(
"touch",
this.callback
);
console.info("InputMonitorJsTest---end---testOn");
}
}
```
......@@ -78,22 +76,20 @@ on(type: "mouse", receiver: TouchEventReceiver): void
**示例:**
```js
export default {
callback: function (value) {
callback: function (value) {
if (checkEvent(value)) {
//事件满足业务要求,事件被消费
} else {
//事件不满足业务要求,事件未被消费
}
},
testOn: function () {
},
testOn: function () {
console.info("InputMonitorJsTest---start---testOn");
inputMonitor.on(
"mouse",
this.callback
);
console.info("InputMonitorJsTest---end---testOn");
}
}
```
......@@ -118,8 +114,7 @@ off(type: "touch", receiver: TouchEventReceiver): void
**示例:**
```js
export default {
callback: function (value) {
callback: function (value) {
if (checkEvent(value)) {
//事件满足业务要求,事件被消费
return true;
......@@ -127,16 +122,15 @@ export default {
//事件不满足业务要求,事件未被消费
return false;
}
},
testOff: function () {
},
testOff: function () {
console.info("InputMonitorJsTest---start---testOff");
inputMonitor.off(
"touch",
this.callback
);
console.info("InputMonitorJsTest---end---testOff");
}
}
}
```
off(type: "mouse", receiver?: Callback<MouseEvent>): void
......@@ -157,23 +151,21 @@ off(type: "mouse", receiver?: Callback<MouseEvent>): void
**示例:**
```js
export default {
callback: function (value) {
callback: function (value) {
if (checkEvent(value)) {
//事件满足业务要求,事件被消费
} else {
//事件不满足业务要求,事件未被消费
}
},
testOff: function () {
},
testOff: function () {
console.info("InputMonitorJsTest---start---testOff");
inputMonitor.off(
"touch",
this.callback
);
console.info("InputMonitorJsTest---end---testOff");
}
}
}
```
......@@ -202,8 +194,7 @@ export default {
**示例:**
```js
export default {
callback: function (value) { //此处为(touchEvent:TouchEvent): Boolean 方法的实现
callback: function (value) { //此处为(touchEvent:TouchEvent): Boolean 方法的实现
if (checkEvent(value)) {
//事件满足业务要求,事件被消费
return true;
......@@ -211,14 +202,13 @@ export default {
//事件不满足业务要求,事件未被消费
return false;
}
},
testOff: function () {
},
testOff: function () {
console.info("InputMonitorJsTest---start---testOff");
inputMonitor.off(
"touch",
this.callback
);
console.info("InputMonitorJsTest---end---testOff");
}
}
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册