|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
if (ename !== "wheel") |
|
|
if (ename !== "wheel") |
|
|
this.__emitter.emit(ename, data); |
|
|
this.__emitter.emit(ename, data); |
|
|
|
|
|
if (data.delta < 0) |
|
|
|
|
|
this.__emitter.emit("wheeldown", data); |
|
|
|
|
|
if (data.delta > 0) |
|
|
|
|
|
this.__emitter.emit("wheelup", data); |
|
|
this.__emitter.emit("wheel", data); |
|
|
this.__emitter.emit("wheel", data); |
|
|
} |
|
|
} |
|
|
}).bind(this); |
|
|
}).bind(this); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
listen(ename, func, owner=null, once=false){ |
|
|
listen(ename, func, owner=null, once=false){ |
|
|
if ((["keyup", "keydown", "keypress", "mousemove", "mousedown", "mouseup", "mouseclick", "wheel"]).indexOf(ename) >= 0){ |
|
|
|
|
|
|
|
|
if (([ |
|
|
|
|
|
"keyup", |
|
|
|
|
|
"keydown", |
|
|
|
|
|
"keypress", |
|
|
|
|
|
"mousemove", |
|
|
|
|
|
"mousedown", |
|
|
|
|
|
"mouseup", |
|
|
|
|
|
"mouseclick", |
|
|
|
|
|
"wheel", |
|
|
|
|
|
"wheelup", |
|
|
|
|
|
"wheeldown" |
|
|
|
|
|
]).indexOf(ename) >= 0){ |
|
|
this.__emitter.listen(ename, func, owner, once); |
|
|
this.__emitter.listen(ename, func, owner, once); |
|
|
} else { |
|
|
} else { |
|
|
ename = ReorderEventName(ename); |
|
|
ename = ReorderEventName(ename); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
unlisten(ename, func, owner=null){ |
|
|
unlisten(ename, func, owner=null){ |
|
|
if ((["keyup", "keydown", "keypress", "mousemove", "mousedown", "mouseup", "mouseclick", "wheel"]).indexOf(ename) >= 0){ |
|
|
|
|
|
|
|
|
if (([ |
|
|
|
|
|
"keyup", |
|
|
|
|
|
"keydown", |
|
|
|
|
|
"keypress", |
|
|
|
|
|
"mousemove", |
|
|
|
|
|
"mousedown", |
|
|
|
|
|
"mouseup", |
|
|
|
|
|
"mouseclick", |
|
|
|
|
|
"wheel", |
|
|
|
|
|
"wheelup", |
|
|
|
|
|
"wheeldown" |
|
|
|
|
|
]).indexOf(ename) >= 0){ |
|
|
this.__emitter.unlisten(ename, func, owner); |
|
|
this.__emitter.unlisten(ename, func, owner); |
|
|
} else { |
|
|
} else { |
|
|
ename = ReorderEventName(ename); |
|
|
ename = ReorderEventName(ename); |