while (1) e = getEvent() if (e != none) DispatchEvent(e)
window.addEventListener("focus",FocusFunc);
var tmpCanvas = this; canvas.addEventListener("focus", function( evnt) { tmpCanvas.FocusFun(tmpCanvas, evnt) } );
this.x = canvas.offsetLeft; this.y = canvas.offsetTop; canvas.addEventListener("click", function(evnt) { tmpCanvas.ClickFunc(tmpCanvas, evnt); } ); ClickFunc: function (me, evnt) { var x = evnt.clientX-me.x; var y = evnt.clientY-me.y console.log("In mousepress, Real", x, y); console.log("\t\t raw", evnt.clientX, evnt.clientY); me.ChangeAnimation(); },
var canvas = document.createElement('canvas') canvas.tabIndex = 0; // -1 : no focus, 0: in rotation 1+: priority canvas.height = height;
case 'M': me.canvas.addEventListener("mousemove",this._Listener); break; case 'm': me.canvas.removeEventListener("mousemove",this._Listener); break;
_Listener: function(evnt) { if (typeof arguments.callee.me == 'undefined') { arguments.callee.me = this; } if (typeof evnt != "undefined") { arguments.callee.me.MouseFunc(arguments.callee.me, evnt); } },
MouseFunc: function(me, evnt) { var x = evnt.clientX-me.x; var y = evnt.clientY-me.y console.log("Mickey Says ",x, y); },