Check for right click on mouse

I believe that if you are using a mouse and you left click it opens something like a menu, where as right click apparently closes it. So how do I check for mouse clicks? 

if (Input.isTriggered("cancel")) { this._window.close(); this.popScene(); }So whats the mouse equivalent.
I believe mouse clicks are handled in the TouchInput, according to the comments above the functions in the file it seems like 

TouchInput.isCancelled()If to check for right click.

For left click its just the other ones, isTriggered() isPressed() isRepeated() isLongPressed()
You have two options:

1) Add an event listener on the document;

2) Alias the TouchInput._onRightButtonDown
If possible, subclass your menu window from Window_Selectable or one of its subclasses. It makes things a whole lot easier. Or simply take a look at how it's handled there.
I do subclass from window selectable but apparently people cannot seem to right click to get out of the current scene and back to the menu. Ill look at the other option sugested
Ok, then add a handler for the 'cancel' event, like this:

Code:
this._commandWindow.setHandler('cancel',    this.popScene.bind(this));
This is part of the code of Scene_Menu and causes the menu to close, when the 'cancel' event is triggered while Window_MenuCommand is active.
Closed due to OP's request.

Original thread: https://forums.rpgmakerweb.com/threads/check-for-right-click-on-mouse.51903/