add: root_automator

This commit is contained in:
hyb1996
2017-08-01 21:42:32 +08:00
parent 8734ae3992
commit 6a3392cfe6
22 changed files with 474 additions and 112 deletions

View File

@@ -89,7 +89,7 @@ events.onKeyDown("menu", function(event){
### events.onTouch(listener)
* listener \<Function\> 参数为Point的函数
注册一个触摸监听函数。
注册一个触摸监听函数。相当于`on("touch", listener)`
例如:
```
@@ -147,6 +147,28 @@ events.loop();
```
### obverseNotification()
### toast事件
### 事件: 'notification'
* notification \<Notification\> 通知
```
events.observeNotification();
events.on("notification", function(notification){
log(notification.
});
```
# EventEmitter
### EventEmitter.defaultMaxListeners
@@ -155,7 +177,7 @@ events.loop();
设置 EventEmitter.defaultMaxListeners 要谨慎,因为会影响所有 EventEmitter 实例,包括之前创建的。 因而,调用 emitter.setMaxListeners(n) 优先于 EventEmitter.defaultMaxListeners。
注意与NodeJs不同**这是一个硬性限制**。 EventEmitter 实例不允许添加更多的监听器监听器超过最大数量时会抛出TooManyListenersException。
注意与Node.js不同**这是一个硬性限制**。 EventEmitter 实例不允许添加更多的监听器监听器超过最大数量时会抛出TooManyListenersException。
```
emitter.setMaxListeners(emitter.getMaxListeners() + 1);
emitter.once('event', () => {

View File

@@ -1,5 +1,5 @@
{
"global" : {
"global": {
"modules": [
"app",
"automator",
@@ -39,7 +39,7 @@
"openConsole",
"clearConsole"
],
"dialogs":[
"dialogs": [
"rawInput",
"input",
"alert",
@@ -142,12 +142,12 @@
"Text"
],
"timers": [
"loop",
"setTimeout",
"clearTimeout",
"setInterval",
"clearInterval",
"setImmediate",
"loop",
"setTimeout",
"clearTimeout",
"setInterval",
"clearInterval",
"setImmediate",
"clearImmediate"
],
"web": [
@@ -211,7 +211,7 @@
"error",
"assert"
],
"dialogs":[
"dialogs": [
"select",
"singleChoice",
"multiChoice",
@@ -248,6 +248,8 @@
"onKeyUp",
"onceKeyDown",
"onceKeyUp",
"onToast",
"onNotification",
"removeAllKeyDownListeners",
"removeAllKeyUpListeners",
"onTouch",