...
Issue:
- Mouse up event will be cancelled when multi-button down and release the first one then the second one
Canvas Javascript var stage, text; function init() { stage = new createjs.Stage("demoCanvas"); // Get EaselJS's stage to register to the canvas named "demoCanvas", can have multiple text = new createjs.Text("Press:", "20px Arial", "#ff7700"); text.x = 10; text.y = 10; AJS.$('demoCanvasimg').bind('contextmenu(', function(event) {{ // Disable context menu return false; }); stage.addChild(text); stage.addEventListener("stagemousedown", handleMouseDown); stage.addEventListener("stagemouseup" , handleMouseUp); createjs.Ticker.addEventListener("tick", tick); } function handleMouseDown(event){ text.text += "\r\n"; text.text += "Mouse Down Code = " + event.nativeEvent.button; } function handleMouseUp(event){ text.text += "\r\n"; text.text += "Mouse Up Code = " + event.nativeEvent.button; } function tick(event){ stage.update(); } AJS.toInit( function(){ init(); });
...