Right Click Common Event

I have a common event set up so when the Tab key is pressed, something happens and it works great. 
(Using conditional branch with script: Input.isPressed('tab') )


Because my game also uses the mouse input feature that is baked into MV, I was wondering if It's possible to have a right click (anywhere) do the same thing that pressing tab does. 
Like is there a script or something that I could use with conditional branches (just like the aforementioned script) that will check if the player right clicked?
It doesnt need to be any specific point on the map, rather just use it as a regular button. 
Thanks!
Would it not be a problem that the mouse right click is hard coded to do things like open the main menu?  Players who use the mouse will expect that sort of consequence from right clicking, not anything else.
Weird, that doesnt work for me. I am using a custom evented menu, if thats the reason. It's set so when you hit esc, my pause menu appears, instead of the default menu. 
But even so, right clicking doesnt do anything. Theres no way of using it for a custom command/common event?


Thanks


EDIT:
After making a new project, I see that right clicking does bring up the menu, but that doesnt apply to me because Im not using that menu.
Fair enough.  I presume you've already got something in place to tell the player that the mouse doesn't behave in the 'normal' way, so they will be alert to what you want to do.
Yes, exactly. I'm just looking for a way to use the right mouse button for something other than the menu.
I am not sure if it includes the mouse button clicks butt Yanfly has a plugin called Button Common Event that might include the right mouse click.
Ive looked into that, but unfortunately it doesn't have what I need. Thanks anyway 🙂
Hi!


The script call to check for RMB is:


TouchInput.isCancelled()


You can use it in a conditional: script to duplicate the pressing tab effects, using a label  would be the simplest solution.


Or you could use the small script snippet below: paste it into a .js file, name doesn't matter and import it below all other plugins.

Spoiler
(function() {
var _Astfgl_newSMU = Scene_Map.prototype.update
Scene_Map.prototype.update = function() {
_Astfgl_newSMU.call(this);
if (TouchInput.isCancelled()) {
$gameTemp.reserveCommonEvent(4); //change 4 to the id of the common event you want to call
}
}
})();



This will only work on the map scene, though.

Original thread: https://forums.rpgmakerweb.com/threads/right-click-common-event.72263/