MV Script to assign a button to a common event

Is there a way to assign roles to other key buttons that aren't being used for the game? If so, how? I think it would be neat if I could assign a button not being used to call a Common Event.

Thanks for reading!
Yanfly has a plugin for that: http://www.yanfly.moe/wiki/Button_Common_Events_(YEP). I think you can only buy it in a bundle though, for $10, or for $30 if you buy the full collection of plugins. But maybe you can do a search for "Button Common Event" and see if any alternatives come up for MV.
Hi,
I've been delving into RPG MV code and learning what it all does.
So, there may be some side effect I don't yet know about, but you can easily write your own script for this, although Yanflys is no doubt a million times better.
Just put the below in a file under the JS > Plugins folder and give it a ".js" extension.

Note, this is for keyboard, not gamepad buttons.
JavaScript:
(function($){
 
  //Use this site "https://keycode.info/" to find the keycode for the button you want.
  Input.keyMapper[55] = "7";
 
  var Alias_Scene_Map_updateMain = Scene_Map.prototype.updateMain;

  Scene_Map.prototype.updateMain = function() {
    Alias_Scene_Map_updateMain.call(this);
     if (Input.isTriggered('7')) { // where "7" has to appear exactly as it does when you write Input.keyMapper[55] = "7"
      $gameTemp.reserveCommonEvent(1); //where "1" is the Common Event ID
     }
  }
})()

If you don't want a plugin. Just try putting your desired key declaration "Input.keyMapper[55] = '7';" into a event script call and set a switch to true, and then have a common event running in parallel, which runs a check for the conditional script "Input.isTriggered('7')" while the switch is on, and then have the common event call a different common event that does what the button press is supposed to accomplish.

Hm, sounds complicated. Maybe someone else has something easier?
Moved to: Plugin Requests
Mano_InputConfig has the ability to call common events from any button.
This plugin is free and versatile, with very few conflicts.
The above thread and plugin distribution URL is for MZ, but this plugin is designed to work with MV as well.

Original thread: https://forums.rpgmakerweb.com/threads/script-to-assign-a-button-to-a-common-event.139007/