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

inputmonitor 资料补齐

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