Skip to content

Commit 1b4e53d

Browse files
committed
Exposed buttons event property.
1 parent e17118c commit 1b4e53d

10 files changed

Lines changed: 23 additions & 36 deletions

File tree

v3/src/checksum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var CHECKSUM = {
2-
build: '38e2f870-70e5-11e7-b8c1-e1e51940ad94'
2+
build: 'ef2515e0-70eb-11e7-ad8e-3beabf57a909'
33
};
44
module.exports = CHECKSUM;

v3/src/input/InteractiveObject.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,27 @@ var InteractiveObject = new Class({
2929
// onDragEnd: NOOP
3030
},
3131

32-
onUp: function ()
32+
onUp: function (gameObject, pointer, x, y)
3333
{
3434
// Empty by default. Override via setCallback.
3535
},
3636

37-
onDown: function ()
37+
onDown: function (gameObject, pointer, x, y)
3838
{
3939
// Empty by default. Override via setCallback.
4040
},
4141

42-
onOver: function ()
42+
onOver: function (gameObject, pointer, x, y)
4343
{
4444
// Empty by default. Override via setCallback.
4545
},
4646

47-
onOut: function ()
47+
onOut: function (gameObject, pointer)
4848
{
4949
// Empty by default. Override via setCallback.
5050
},
5151

52-
onMove: function ()
52+
onMove: function (gameObject, pointer, x, y)
5353
{
5454
// Empty by default. Override via setCallback.
5555
},

v3/src/input/local/SceneInputManager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ var Class = require('../../utils/Class');
22

33
// Drag Events
44
// https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API
5+
// Mouse Events
6+
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
57

68
var SceneInputManager = new Class({
79

v3/src/input/local/components/ProcessMoveEvents.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,6 @@ var ProcessMoveEvents = function (pointer)
2222
}
2323

2424
/*
25-
var i;
26-
var interactiveObject;
27-
28-
if (currentlyOver.length === 0)
29-
{
30-
// Dispatch MOVE event, even though pointer isn't over anything
31-
this.events.dispatch(new InputEvent.MOVE(pointer));
32-
}
33-
else
34-
{
35-
// Go through all objects the pointer is over and dispatch them
36-
for (i = 0; i < currentlyOver.length; i++)
37-
{
38-
interactiveObject = currentlyOver[i];
39-
40-
this.events.dispatch(new InputEvent.MOVE(pointer, interactiveObject.gameObject, currentlyOver));
41-
42-
this.childOnMove(pointer, interactiveObject);
43-
44-
if (this.topOnly)
45-
{
46-
break;
47-
}
48-
}
49-
}
50-
5125
// Check the list of Draggable Items
5226
for (i = 0; i < this.children.draggable.length; i++)
5327
{

v3/src/input/local/events/PointerDownEvent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ var PointerDownEvent = new Class({
1717
// The native DOM event (MouseEvent, TouchEvent, etc)
1818
this.event = pointer.event;
1919

20-
// The button that was released. This is read directly from the DOM event.
21-
this.button = pointer.event.button;
20+
// The button/s used in this event. This is read directly from the DOM event.
21+
this.buttons = pointer.event.buttons;
2222

2323
// The x/y coordinates of the event
2424
this.x = pointer.x;

v3/src/input/local/events/PointerMoveEvent.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ var PointerMoveEvent = new Class({
1717
// The native DOM event (MouseEvent, TouchEvent, etc)
1818
this.event = pointer.event;
1919

20+
// The button/s used in this event. This is read directly from the DOM event.
21+
this.buttons = pointer.event.buttons;
22+
2023
// The x/y coordinates of the event
2124
this.x = pointer.x;
2225
this.y = pointer.y;

v3/src/input/local/events/PointerOutEvent.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ var PointerOutEvent = new Class({
1717
// The native DOM event (MouseEvent, TouchEvent, etc)
1818
this.event = pointer.event;
1919

20+
// The button/s used in this event. This is read directly from the DOM event.
21+
this.buttons = pointer.event.buttons;
22+
2023
// The x/y coordinates of the event
2124
this.x = pointer.x;
2225
this.y = pointer.y;

v3/src/input/local/events/PointerOverEvent.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ var PointerOverEvent = new Class({
1717
// The native DOM event (MouseEvent, TouchEvent, etc)
1818
this.event = pointer.event;
1919

20+
// The button/s used in this event. This is read directly from the DOM event.
21+
this.buttons = pointer.event.buttons;
22+
2023
// The x/y coordinates of the event
2124
this.x = pointer.x;
2225
this.y = pointer.y;

v3/src/input/local/events/PointerUpEvent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ var PointerUpEvent = new Class({
1717
// The native DOM event (MouseEvent, TouchEvent, etc)
1818
this.event = pointer.event;
1919

20-
// The button that was released. This is read directly from the DOM event.
21-
this.button = pointer.event.button;
20+
// The button/s used in this event. This is read directly from the DOM event.
21+
this.buttons = pointer.event.buttons;
2222

2323
// The x/y coordinates of the event
2424
this.x = pointer.x;

v3/src/plugins/InputManager.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ var InputManager = new Class({
1313
SceneInputManager.call(this, scene, game);
1414
},
1515

16+
/*
1617
childOnMove: function (pointer, interactiveObject)
1718
{
1819
interactiveObject.onMove(interactiveObject.gameObject, pointer);
@@ -53,6 +54,7 @@ var InputManager = new Class({
5354
5455
interactiveObject.onDragEnd(interactiveObject.gameObject, pointer);
5556
}
57+
*/
5658

5759
});
5860

0 commit comments

Comments
 (0)