MZ Enable/disable and re-bind escape button and right-click to common events

Hello!

RMMZ, v1.5.0

There are plugins available to re-bind nearly all the keyboard keys, and that's great! In fact, something like Button Common Events (http://www.yanfly.moe/wiki/Button_Common_Events_VisuStella_MZ) does a chunk of what I need, except it does not bring any function to the escape key or right-click.

So specifically what I would like, is a plugin with options to enable/disable the default functions of escape and right-click. That is to say, they "return", exiting out of menus, and open the main menu if on the map scene. I would love if I could disable that they open the main menu, but could still be used to exit out of any menus if they're open.

With the above, if the default action of opening the menu is disabled, then allow it to play a chosen common event instead. Both escape and right-click having an option for separate common events. This would play well with other plugins or custom screens you open, but still being able to exit out of them with escape/right-click - essentially replacing the main menu.

So in other words, I could bind the escape key to play a common event that launches a custom "main menu", and bind the right-click key to a common event that... fires a projectile from another plugin - or just also open the custom menu etc.

Hopefully I described it properly, please do say if I wasn't clear. Thank you for reading!
Have you tried the Change Menu Access event command?
Hi there!
I guess the @caethyril solution could solve your problem and keep you using the same plugin you already use.

I don't know if I really understand you right, but I guess if you want something like that:

Then maybe my plugin can help you out. I just don't have the Mouse Clicks holding common events, yet. I will try to add it.
Have you tried the Change Menu Access event command?
I seem to have missed this, that's really very useful. Thank you!
Now I just need to figure out how to bind a common event to the escape key and right mouse click. Any help would be appreciated, whether through a plugin or code that could explain how to do so. I'll try myself too, of course.

Hi there!
I guess the @caethyril solution could solve your problem and keep you using the same plugin you already use.

I don't know if I really understand you right, but I guess if you want something like that:

Then maybe my plugin can help you out. I just don't have the Mouse Clicks holding common events, yet. I will try to add it.
Thank you for the suggestion! Unfortunately your terms of use do not allow me to make use of any of your plugins, which is unfortunate. I appreciate the help nonetheless!
By default the Esc, Insert, X, and Numpad-0 keyboard inputs (key codes 27, 45, 88, 96 respectively) are named escape, so you could try binding to that? In case it's relevant, escape also counts as both menu (opens pause menu on the map) and cancel (e.g. back out of menus). Gamepads already use separate buttons for menu and cancel.

Right-click and multi-touch count as a "touch cancel", but I'm not sure if the VisuStella plugin you linked handles touch inputs.
By default the Esc, Insert, X, and Numpad-0 keyboard inputs (key codes 27, 45, 88, 96 respectively) are named escape, so you could try binding to that? In case it's relevant, escape also counts as both menu (opens pause menu on the map) and cancel (e.g. back out of menus). Gamepads already use separate buttons for menu and cancel.

Right-click and multi-touch count as a "touch cancel", but I'm not sure if the VisuStella plugin you linked handles touch inputs.
Thanks, happened to solve my issue via a different plugin ("Key Commands" by KageDesu) that allows you to type in the keyboard key you wish to bind a common event to. If that hadn't worked I would've tried making a custom plugin, but it worked like a charm!
The right-click part I'm fine with just binding to combat functions in the plugin I use instead of a menu. Thanks again for the info!

Original thread: https://forums.rpgmakerweb.com/threads/enable-disable-and-re-bind-escape-button-and-right-click-to-common-events.152187/