From bfdd6f501f462f0a3a4f7b388086587d7586d3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 2 Mar 2017 15:00:59 +0100 Subject: [PATCH] add: mouse-Start -Move -End event dispatcher --- virtualjoystick.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virtualjoystick.js b/virtualjoystick.js index 804af04..1de1086 100644 --- a/virtualjoystick.js +++ b/virtualjoystick.js @@ -218,6 +218,7 @@ VirtualJoystick.prototype._onMove = function(x, y) VirtualJoystick.prototype._onMouseUp = function(event) { + this.dispatchEvent('mouseEnd', event); return this._onUp(); } @@ -226,6 +227,7 @@ VirtualJoystick.prototype._onMouseDown = function(event) event.preventDefault(); var x = event.clientX; var y = event.clientY; + this.dispatchEvent('mouseStart', event); return this._onDown(x, y); } @@ -233,6 +235,7 @@ VirtualJoystick.prototype._onMouseMove = function(event) { var x = event.clientX; var y = event.clientY; + this.dispatchEvent('mouseMove', event); return this._onMove(x, y); }