TouchInput._onMouseDown

TouchInput._onMouseDown = function(event) { if (event.button === 0) { this._onLeftButtonDown(event); } else if (event.button === 1) { this._onMiddleButtonDown(event); } else if (event.button === 2) { this._onRightButtonDown(event); }};TouchInput._onRightButtonDown = function(event) { var x = Graphics.pageToCanvasX(event.pageX); var y = Graphics.pageToCanvasY(event.pageY); if (Graphics.isInsideCanvas(x, y)) { }};How do I use this?

I tried 'reverse engineering' http://forums.rpgmakerweb.com/index.php?/topic/48878-how-to-figure-out-if-right-mouse-button-is-pressed/ but I think I grew a tumor.

What is the 'event.button' and the '(event)' parameter?
At work at 5he moment but I'd imagine "event" is either a Game_Event object (the map objects) or a some native interpreter event used to pass data about an input action.

In 5his vase the "button" property looks like a code where 0: left mouse button, 1: middle, 2: right.
Event is the data from the mouse down JS event, there's no relation to RM events.
So if I wanted to use a conditional to check if the right mouse button is pressed, what do I put for the '(event)'.

I tried the codes and a bunch of other unintelligible combinations. I get "button is not defined" most of the time.

Do I need to use a switch like in Hudell's OrangeMouseData.js to turn on when MouseDown and turn off when MouseUp?

A little elbow grease and we got it.  Here is what I did if anyone else has trouble with the easy parts:

TouchInput.clear = function() { this._mousePressed = false; this._screenPressed = false; this._pressedTime = 0; this._events = {}; this._events.triggered = false; this._events.cancelled = false; this._events.moved = false; this._events.released = false; this._events.wheelX = 0; this._events.wheelY = 0; this._triggered = false; this._cancelled = false; this._moved = false; this._released = false; this._wheelX = 0; this._wheelY = 0; this._x = 0; this._y = 0; this._date = 0; this._rightMouse = false;};TouchInput._onRightButtonDown = function(event) { var x = Graphics.pageToCanvasX(event.pageX); var y = Graphics.pageToCanvasY(event.pageY); if (Graphics.isInsideCanvas(x, y)) { this._rightMouse = true; }};TouchInput._onMouseUp = function(event) { if (event.button === 0) { var x = Graphics.pageToCanvasX(event.pageX); var y = Graphics.pageToCanvasY(event.pageY); this._mousePressed = false; this._onRelease(x, y); } else if (event.button === 2) { this._rightMouse = false; };};Then you can put 'TouchInput._rightMouse === true' in an event conditional.

Original thread: https://forums.rpgmakerweb.com/threads/touchinput-_onmousedown.54307/