From 692eab9f636f3b6ba133a2635c92081c0fa66d4d Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 14 Jan 2015 01:49:27 +0000 Subject: [PATCH 1/2] - fix mouseup/mousedown event handler, not working properly with different mouse buttons --- src/easeljs/display/Stage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/easeljs/display/Stage.js b/src/easeljs/display/Stage.js index 9cb662548..c017e64fd 100644 --- a/src/easeljs/display/Stage.js +++ b/src/easeljs/display/Stage.js @@ -702,7 +702,7 @@ this.createjs = this.createjs||{}; * @param {MouseEvent} e **/ p._handleMouseUp = function(e) { - this._handlePointerUp(-1, e, false); + this._handlePointerUp(event.button, e, false); }; /** @@ -739,7 +739,7 @@ this.createjs = this.createjs||{}; * @param {MouseEvent} e **/ p._handleMouseDown = function(e) { - this._handlePointerDown(-1, e, e.pageX, e.pageY); + this._handlePointerDown(event.button, e, e.pageX, e.pageY); }; /** From d41fd4c2a5baf4fa4eeaf86b26ad0e79ee20e2e1 Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Thu, 15 Jan 2015 05:05:15 +0000 Subject: [PATCH 2/2] - make sure the mouse id is less than 0 --- src/easeljs/display/Stage.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/easeljs/display/Stage.js b/src/easeljs/display/Stage.js index c017e64fd..46c8f8994 100644 --- a/src/easeljs/display/Stage.js +++ b/src/easeljs/display/Stage.js @@ -628,7 +628,9 @@ this.createjs = this.createjs||{}; **/ p._handleMouseMove = function(e) { if(!e){ e = window.event; } - this._handlePointerMove(-1, e, e.pageX, e.pageY); + + // make sure the mouse id is <0 (means its not touch) + this._handlePointerMove(-(event.button + 1), e, e.pageX, e.pageY); }; /** @@ -702,7 +704,8 @@ this.createjs = this.createjs||{}; * @param {MouseEvent} e **/ p._handleMouseUp = function(e) { - this._handlePointerUp(event.button, e, false); + // make sure the mouse id is <0 (means its not touch) + this._handlePointerUp(-(event.button + 1), e, false); }; /** @@ -739,7 +742,8 @@ this.createjs = this.createjs||{}; * @param {MouseEvent} e **/ p._handleMouseDown = function(e) { - this._handlePointerDown(event.button, e, e.pageX, e.pageY); + // make sure the mouse id is <0 (means its not touch) + this._handlePointerDown(-(event.button + 1), e, e.pageX, e.pageY); }; /**