diff --git a/src/input/Mouse.js b/src/input/Mouse.js index 3a781c01..6abbd983 100644 --- a/src/input/Mouse.js +++ b/src/input/Mouse.js @@ -41,6 +41,11 @@ Phaser.Mouse = function (game) { * @default */ this.mouseUpCallback = null; + /** + * @property {Description} mouseTypeDown - The type of click. -1 for not clicking + * @default + */ + this.mouseTypeDown = -1; /** * You can disable all Input by setting disabled = true. While set all new input related events will be ignored. @@ -119,6 +124,8 @@ Phaser.Mouse.prototype = { event.preventDefault(); + this.mouseTypeDown = event.which - 1; + if (this.mouseDownCallback) { this.mouseDownCallback.call(this.callbackContext, event); @@ -169,6 +176,8 @@ Phaser.Mouse.prototype = { event.preventDefault(); + this.mouseTypeDown = -1; + if (this.mouseUpCallback) { this.mouseUpCallback.call(this.callbackContext, event); @@ -262,4 +271,4 @@ Phaser.Mouse.prototype = { } -}; \ No newline at end of file +};