Script for changing button functions

Hello. Is there a way to change the Shift key to something else? Like, instead of running, can the Shift key do whatever it is I want to, whether it be jump, choice selection, etc?

How and where would I do this inside Rpg Maker Mv?

Thanks for reading.
Okay, I will try to phrase another way.

Is there a script or script editor? Or a code or line or something? I want the Shift key when pressed to do something completely different. Is this possible and if so, how?

For that matter, what about all the other keys? (Out of curiosity for this question)
The inputs are defined in the code in Input.keyMapper. You can make a plugin with that variable and add/remove/redefine any keys you like to those game functions.

You could also use, in-game, Yanfly's keyboard config (or I think a few people have made versions, Eli might have one).
The inputs are defined in the code in Input.keyMapper. You can make a plugin with that variable and add/remove/redefine any keys you like to those game functions.

You could also use, in-game, Yanfly's keyboard config (or I think a few people have made versions, Eli might have one).
This is great, thanks! Do you know where the Input. key mapper is though? 😅

A quick google search using "where is the input key mapper in rpg maker mv"
are not giving the answers I was hoping for.
This is great, thanks! Do you know where the Input. key mapper is though? 😅

A quick google search using "where is the input key mapper in rpg maker mv"
are not giving the answers I was hoping for.
Just go to your js directory where all of the code is and type it into your Windows search bar. It will search the contents of all the files there and tell you that it's in rpg_core.js.

Also, when you do Google, you shouldn't use so many words. You're not asking a question to another person using correct English, you're telling a machine what words to search for. So every word that isn't specifically necessary for your answer is a waste, because the search engine will be discarding potentially helpful responses that don't have the words you asked for (such as "where is the," and "in").

Then make sure that the words you do include are spelled correctly, as I provided in my previous post (you spelled "input.keymapper" two different ways, neither of them correct).

When I Google "rpg maker mv input.keymapper" I immediately get discussion threads from this forum (admittedly none of them list which file the array is in, but that's because it's so simple to find it on your computer that I presume no one thinks it's worth mentioning).
By Javascript directory, is that in Rpg Maker Mv? Or are we talking about an actual file in the Rpg Maker Mv folder?
When I Google "rpg maker mv input.keymapper" I immediately get discussion threads from this forum (admittedly none of them list which file the array is in, but that's because it's so simple to find it on your computer that I presume no one thinks it's worth mentioning).
Simple for people who already know. But with little context makes it very hard for me. And like you said, Google doesn't help. So how does one find something they don't know what they are looking for?
By Javascript directory, is that in Rpg Maker Mv? Or are we talking about an actual file in the Rpg Maker Mv folder?
Again, you're slightly changing what I said - I said js directory. In every single project you make, there is a js directory that holds all of the engine's code. I almost guarantee you know this because any plugins go into js\plugins, so you've navigated through it if you've installed any plugins. 😉
Simple for people who already know. But with little context makes it very hard for me. And like you said, Google doesn't help. So how does one find something they don't know what they are looking for?
Well, there are a few ways one might learn it. One is that many classes or tutorials on basic coding teach how to search for text in files in a directory. That includes the Windows search bar, the Linux grep utility, or some programs like Notepad++.

The other way is...looking that up. If you don't get helpful results from specifically looking up RPG Maker and Input.keymapper, you might Google "how search text files" and the top result is step-by-step instructions mirroring what I told you above.
Again, you're slightly changing what I said - I said js directory. In every single project you make, there is a js directory that holds all of the engine's code. I almost guarantee you know this because any plugins go into js\plugins, so you've navigated through it if you've installed any plugins. 😉
I'm not sure how I am changing what you said. I literally do not know what a JS directory is. From reading your post, I am now assuming the Js directory is the plugin manager. (Note: I should probably mention I have never installed plugins before. But they look interesting)

I'm also just a very confused person so...yeah 😛

I just came back to post thank you for trying to help me. I just didn't want to forget to say thank you. ^_^
I'm not sure how I am changing what you said. I literally do not know what a JS directory is.
Okay - you may want to look up some tutorials for whatever operating system you use (e.g. Windows 10). Between this and the whole search bar thing, it's pretty basic terminology and computer usage that a lot of instructions and RPG Maker tutorials (or just stuff on the Web and in life) will assume you know 🙂

A directory is, in Windows, also referred to as a folder (there is a difference, but it's way technical and not useful to you).

Every time you make an RPG Maker project, it copies a whole bunch of files into different folders inside of your project directory. One of those is js, where all of the code for your game lives, as well as any plugins you might choose to install.

This is the opposite of a file. Files are objects in your operating system that do something in some way - folders/directories do not do anything except provide organization and store files inside.

js.jpg
Yanfly's Button Common Events plugin does exactly this! Just make a common event that does whatever you want to happen when a certain button is pressed, and then assign it to that button within the plugin manager. You can private message me if you need further help navigating it and figuring out how to do all this.

Note: Unfortunately, it looks like the Button Common Events plugin is only available as part of a $10 bundle of plugins, and can't be bought singly. However, you could look through the other plugins in the bundle and see if any of the others would be useful enough to you to make the purchase more "worth it" 🙂

~~~~~

ALTERNATIVELY, you can do what ATT said and use keymapping. You don't need to go into any directories to do this (although it could be useful to learn more about that anyway, it isn't necessary to doing what you're asking for here).

The way I do it in my games is I have an event that autoruns at the very start of my game to set up some basic things (e.g. setting certain switches or variables, turning on the HUD, etc.), which then flips a self switch once it's done everything and never has to run again. One of the things I do in this "game start" event is map the keys I want to have certain functions. I simply write a line of script for each one and it might look like this:

Code:
Input.keyMapper[87] = 'up'
Input.keyMapper[65] = 'left'
Input.keyMapper[83] = 'down'
Input.keyMapper[68] = 'right'

That's mapping the WASD keys to have up/left/down/right functions (for character movement). Each number in the brackets corresponds to either the W, A, S, or D key. Every key has a code that can be referenced in JS, and you can find the code for any key you want here.

The words within the single-quotes are... well, I actually don't know enough about JS to explain exactly what that is, but I know how it works. RPG Maker already has some key functions built in. These are 'ok', 'cancel', 'shift', 'down', 'left', 'right', 'up', 'pageup', and 'pagedown'. If you want your shift key to function like any of those other buttons, then just use that word in the code (like I did with the four directions above), and voila!

For example, if you did:
Code:
Input.keyMapper[16] = 'cancel'
...the shift key would now function like the escape key. Based on my experience, you only need to do the keymapping once, and then it should remain the same for the rest of the game, unless you have another event keymap it to something else later on.

~~~~~

If you want the shift key to do something entirely different (that isn't one of the functions built into RPG Maker by default), all you have to do is put a conditional branch in a constantly-running parallel common event to check if that key is pressed, and if it is, then tell the common event what you want to happen. Since shift is one of the default mapped keys, you can do this by simply using the "Button _____ is pressed down" dropdown box on Page 4 when you're setting up your conditional branch. In other words, no keymapping required.

~~~~~

IF, however, you ever want to do this with any other key (that isn't a default key and therefore not in that dropdown box), then you do still have to do the keymapping part. You can name it anything you want - I usually just name it after the key itself, so for example I've done
Code:
Input.keyMapper[18] = 'alt'
to map the alt key as 'alt' (rather than 'ok', 'cancel', or etc.) When it comes to making things actually happen, you'd just do the same thing with using a conditional branch in a continuous parallel common event, but instead of choosing from the dropdown box as the condition, you'd pick the "Script" option (also on Page 4) and use whatever you named the function of that button to check if that button is being pressed:


Code:
Input.isTriggered('alt')
or
Code:
Input.isPressed('alt')

The "isTriggered" version checks if the button has been pressed at all, even for a single frame, while the "isPressed" version checks if the button has been held down for several frames (I forget how many). There are other versions of this script call, too (like long pressing) that you could look up here if it ever interests you (scroll down a bit to "Button input" in the leftmost column).

Overall, you can probably use this keymapping method to basically accomplish whatever the Yanfly plugin would, just with a bit more work.

~~~~~

That was a lot of information, but I wanted to give you lots of options, for both now and in the future! I had to find all this information in lots of separate places as my needs changed and evolved. Let me know if any part of it overwhelms or confuses you, and please don't hesitate to reach out in private messaging for further clarification either!
If you want the shift key to do something entirely different (that isn't one of the functions built into RPG Maker by default), all you have to do is put a conditional branch in a constantly-running parallel common event to check if that key is pressed, and if it is, then tell the common event what you want to happen. Since shift is one of the default mapped keys, you can do this by simply using the "Button _____ is pressed down" dropdown box on Page 4 when you're setting up your conditional branch. In other words, no keymapping required.

That's what I have been doing. Running a Common event parallel process with a wait to see if the Shift key has been pressed. But I thought maybe that was too cumbersome. And that I should just literally change what the Shift key does. Because having the background always running to check if the Shift key is pressed to do something else, it just seemed like a bad idea now.

ALTERNATIVELY, you can do what ATT said and use keymapping. You don't need to go into any directories to do this (although it could be useful to learn more about that anyway, it isn't necessary to doing what you're asking for here).
I'm not exactly sure what key mapping is. But reading this, key mapping sounds like an event that auto runs like you said, to change certain keys permanently before the game kicks off. (And then the player plays)

I don't want the Shift key to become another different key, like Escape. I just want it to run the conditions and branches and choice options or whatever I want for it.
Like in example, I turn it to a "Talk" option, so when the player has a team mate, there is a random talk option (just 1-3 random) when the other team mate follows and comments depending on what map they are on.


A directory is, in Windows, also referred to as a folder (there is a difference, but it's way technical and not useful to you).

I saw that JS folder, and wondered at one point if you might have been talking about that. JS stands for Java script I assume. And when I try to open the Javascript files, I cannot. The small icons look like scrolls. I also assume this is maybe where I change key buttons directly if I could open and rewrite it?


I wonder if I should stick with the parallel process Common event original idea but give it the very minimum wait?

That was a lot of information, but I wanted to give you lots of options, for both now and in the future! I had to find all this information in lots of separate places as my needs changed and evolved. Let me know if any part of it overwhelms or confuses you, and please don't hesitate to reach out in private messaging for further clarification either!
I sincerely appreciate it! I've been reading this over. Though right now I feel tired so I will have to read again later. But I wanted to make sure you knew I was looking through what you had to say. So thank you!
The words within the single-quotes are... well, I actually don't know enough about JS to explain exactly what that is, but I know how it works. RPG Maker already has some key functions built in. These are 'ok', 'cancel', 'shift', 'down', 'left', 'right', 'up', 'pageup', and 'pagedown'. If you want your shift key to function like any of those other buttons, then just use that word in the code (like I did with the four directions above), and voila!
That's basically it - the words are just words, strings. Those strings are referenced by other functions in the code to do various things, so you compartmentalize "this is what 'ok' does and this is what 'up' does" and it doesn't matter which physical key(s) are being used.

Because having the background always running to check if the Shift key is pressed to do something else, it just seemed like a bad idea now.
It's not "a bad idea" in bold if that's the only parallel process you have going on. But it is the least efficient way to do what you want.
I'm not exactly sure what key mapping is.
A Google for "key mapping" brings up several articles describing it as the process to control what pressing a key does on a computer, or in a piece of software.
Like in example, I turn it to a "Talk" option, so when the player has a team mate, there is a random talk option (just 1-3 random) when the other team mate follows and comments depending on what map they are on.
The plugin that's been mentioned a few times, Yanfly's Button Common Events, will do this.
I saw that JS folder, and wondered at one point if you might have been talking about that. JS stands for Java script I assume. And when I try to open the Javascript files, I cannot.
Again, this is the kind of thing you'd learn about with some tutorials about using your computer. If you're on Windows, you can right-click on the file and one of the options will be "Open with" - selecting Notepad will open them so you can edit the code.

This will work, but Notepad is a pretty clumsy piece of software for it - the free software Notepad++ is better for editing code.
I wonder if I should stick with the parallel process Common event original idea but give it the very minimum wait?
There's not really a point to that. If you literally give it the minimum wait (1 frame), that doesn't really affect your computer at all. And if you give it more, you run the risk of it missing when the player pushes the button.
Okay, so how would I write code Input.keyMapper[16] = 'X'
to activate a common event? Is this possible?

I have my common events set up, and I can now edit the javascripts in the JS folder.
I figure it's just a matter of typing the code into one of those scroll icons?

The plugin that's been mentioned a few times, Yanfly's Button Common Events, will do this.
I'm not going to pay $10 for that. I don't even pay squat for phone games. lol.
That's what I have been doing. Running a Common event parallel process with a wait to see if the Shift key has been pressed. But I thought maybe that was too cumbersome. And that I should just literally change what the Shift key does. Because having the background always running to check if the Shift key is pressed to do something else, it just seemed like a bad idea now.

I mean, ATT says it's maybe not the most efficient way to do it, but I personally do it all the time and haven't had problems yet. Someone who knows JS better might be able to find a more efficient way to do it, but I've barely scratched the surface so using a common event is the best way I know how 🙂

What I do (and from what I've seen, at least some other people do as well) is just have one main common event entitled "Main Loop" that I switch on at the start of my game and then just have constantly running as a parallel process. And everything that I need to be constantly checking or updating, I put in there (unless something requires waiting in-between, which is the only case I make a separate common event for it, because the waiting will hold up the checking/updating of everything else in the Main Loop event, and like ATT mentioned, can lead to missing when the player presses a button if they press it while the "wait" part of the code is running).

So I would personally recommend this method of doing it. It works, and is easy, so as long as it's not causing visible lag in your game, then I see no reason not to. Now, if you have an extremely complex game with very heavy/cumbersome functions going on in this Main Loop common event all the time, that might be a different story. But it seems like for most people's purposes, it should be fine 🙂

I'm not exactly sure what key mapping is. But reading this, key mapping sounds like an event that auto runs like you said, to change certain keys permanently before the game kicks off. (And then the player plays)

Basically what ATT said! It's just a script call, that's part of assigning a function to a key. It's like you're naming it - although what I called a "name" (such as 'up' or 'alt'), ATT said are actually called "strings".

But it's a two-step process, because once you "name" it, you then have to tell the game what to do when the key by that "name" (i.e. keymapped to that string) is pressed. By default, RPG Maker already has functions associated with those particular strings I had listed out (i.e. 'ok', 'cancel', the four directions, etc.). So if you were to assign/keymap the shift key to the string 'up', for example, it will automatically cause whatever function the 'up' string is associated with (e.g. moving the character up) to happen when the shift key is pressed as well.

You can do this in the very first event that autoruns at the start of your game (you'd need a plugin to make it run before the start of the game, like before the title menu). However, you can also run this same script at any point in the game via any event, and can even re-keymap the key to something different (like, in the middle of the game) after you've already keymapped it before. I just meant to say that that if you run this script at the start of your game (i.e. it's already started, but before the player can do anything or anything else happens), the shift key will have your chosen function from the start of the game, and it will remain unless you manually change it later. Which, in most cases, is what we want!

I don't want the Shift key to become another different key, like Escape. I just want it to run the conditions and branches and choice options or whatever I want for it.
Like in example, I turn it to a "Talk" option, so when the player has a team mate, there is a random talk option (just 1-3 random) when the other team mate follows and comments depending on what map they are on.

Since you want it to do something completely different than any of the default functions built into RPG Maker, then you just have to link whatever "string" you keymapped the shift key to, to whatever common event you want to run when it's pressed.

The Input.keyMapper[<keycode>] = '<string>' script is just the "naming" part. The parallel "Main Loop" common event is where you would check if the key by that "name"/string is being pressed, with the Input.isTriggered('<string>') or Input.isPressed('<string>') script in a conditional branch. Within that conditional branch, you can then call whatever common event you'd like (there's an option to do this directly through the editor, without the need for a script call) 🙂

Like so:

keymap1.png

keymap2.png


From just those script calls in those events, my game will run the "Draw/Sheathe Weapon" common event whenever the player presses the tab key. Within the "Draw/Sheathe Weapon" common event is where I make whatever I want to happen, well, happen!

I don't know why it's two steps (again, maybe someone with more JS knowledge like ATT would know why), but it just is. For some reason you can't directly use the Input.isTriggered script to check if a specific key (by its JS keycode) is pressed; you first have to "name"/keymap it with the Input.keyMapper script and then check if whatever key you've given a particular "name"/string is pressed.

I'm not going to pay $10 for that. I don't even pay squat for phone games. lol.

I don't blame you at all, haha! I have it (because for some particular things I want to do it's just more convenient), but I'm pretty sure I didn't buy it. Or if I did, it was sold singly for like a dollar or two. I've had it for a while and I think the forced bundling is recent, which kind of peeves me, but it is what it is. The good news is that the keymapping method pretty much does the same thing... but like I said, it's just a little more work, and requires that Main Loop to be constantly running if you (like me) don't know JS enough to figure out another way. But again, I've never had problems with it yet. There might be a "better" way, but this isn't a "bad" way.

I have my common events set up, and I can now edit the javascripts in the JS folder.
I figure it's just a matter of typing the code into one of those scroll icons?

So you've been able to open the .js file(s) with Notepad? Just a quick caution: Most people recommend against directly editing and overwriting the .js files, as if it ends up causing problems with your game, there is no backup. I think where ATT was going with this (and ATT please correct me if I'm wrong) is that you can find the code you need to use in these files (it's where all "script calls" come from that you see people sharing online); but if you want to alter it in any way, it's safest to copy & paste the snippet of code you need into a new Notepad document, and then save it as a separate .js file.

How to do that:

Spoiler
All you have to do is "Save As", and literally just add ".js" to the end of the file name, and voila, it's a new .js file! Also known as a "plugin", which you've just made! 😉 So now you would take this new file/plugin and place it into the "plugins" folder that lives inside the original "js" folder. Then open RPG Maker and open your plugin manager, double-click on an empty line to add a plugin, there will be a dropdown menu that shows every plugin in your "plugins" folder, and you just choose the one you want to add. Then confirm and you'll see it in the main plugin manager list. Make sure it's "ON", confirm again, and it should work automatically!

The relevance of this, I think, is that it would replace the keymapping that I did in that first autorunning event. So instead of running the keymapping script once at the beginning of your game, you can put that script in a new .js file/plugin as described above, plug it into your game, and it should work the same way (you still need the parallel common event to check if the key is pressed - this would only replace the initial keymapping/"naming" part). And since we've given you the exact script calls you need, there really shouldn't be any reason you'd have to go looking through the existing, main .js files to find it - I don't think.

@ATT_Turan Can you confirm if it's truly as simple as putting the Input.keyMapper[] script calls directly into a new plugin and it should work, or does the code need to be more complicated to work as a plugin?

The reason I don't do it this way is because, as a plugin (which is in constant effect as long as it's on), it really would make the keymapping permanent throughout the entire game, and I personally have reasons I'd want to change my keymapping mid-game (e.g. temporarily disabling functions, repurposing keys based on context, allowing players to configure their own keys, etc.). Therefore, I use the once-and-done method by just using the script call in events. But if you just want it to stay the same through the entire game, then either method should work.

~~~~~

Anyway, I hope I haven't overwhelmed with information again, so that's why I hid the last bit that was only tangentially related (as using .js files is just an alternate method) in a "spoiler". IMO you might at least try out the method I described in the main part of this response (using only script calls in events) first, just to experience what these script calls do and make sure you understand how they work together, before complicating it with the whole making-it-a-plugin thing. It's actually pretty simple taken one step at a time, but with this much new info, human brains can only learn and conceptualize so much all at the same time haha. So I tried not to get too off-track outside of the "spoiler".

Any other questions? Still any specific points of confusion? Or anything that you're trying but isn't working quite right?
Anyway, I hope I haven't overwhelmed with information again, so that's why I hid the last bit that was only tangentially related
You are amazing. You're so knowledgeable and nice, I can't believe you wrote out so much. I'm taking my time reading and re reading and will be asking more questions when I think of them. I wish I could do something for you in return, but I have only Photoshop skills to offer. And maybe sprite making. But I wanted to let you know that you are talking to someone who appreciates what you're doing and understands the human concept of people losing interests at walls of text. lol.
It's hard being human.

So you've been able to open the .js file(s) with Notepad? Just a quick caution: Most people recommend against directly editing and overwriting the .js files, as if it ends up causing problems with your game, there is no backup.

This is good to know, I'd like to just make a new notepad then. (Make a new JS file) And put in the code to make the Shift key open up a Common event.

Edit: I have back ups of my computers, so there's that.

All you have to do is "Save As", and literally just add ".js" to the end of the file name, and voila, it's a new .js file!

Okay, so all I have to do is create a new notepad, end it with .js.
And inside the notepad, put something like this?
Input.keyMapper[16] = 'X'​
I think I read 16 was the Shift key. I could be wrong though. What does the code look like if I may ask? How do I call a Common Event? (I rather this Common Event for the Shift key not be a parallel process)

I want to mention I can understand maybe very minor and basic code. (And do things as shown/instructed) I've fiddled with website editors growing up. (But that's not saying much lol) I just don't want to come across as a complete newb.

Also,

ATT_Turan​

is amazing too! (Just wanted to get that out there, I appreciate you too!)
You're so knowledgeable

Hah, thanks! 😅 In reality I also know relatively very little about coding/JS, but I've worked with this particular topic in my own games enough that I literally just jumped on this thread like "AHA here's one of the very few things I actually do mostly know about!!" 😤

Okay, so all I have to do is create a new notepad, end it with .js.
And inside the notepad, put something like this?
Input.keyMapper[16] = 'X'​

Yes, exactly! I just tested it myself to make sure that was in fact all you had to do, and yes that absolutely works. And yes, the shift key's JS code is 16 - remember that you can find any key's code here in the future 🙂

How do I call a Common Event? (I rather this Common Event for the Shift key not be a parallel process)

The option to call a common event is on the first event command page, here:

picture.png


The common event that makes what you want the shift key to do happen, is not the one that needs to be parallel. But unfortunately, the only way I know how to connect the pressing of the shift key to actually calling the desired event is to constantly check for if it's being pressed. And the only way I know how to do that is to have a separate, constantly-running parallel event doing that checking. So it would look like the second image I attached in my previous response.

Without this middle piece, you only have a shift key that has been keymapped/"named" and an event that you want to happen when it's pressed, but no way for the game to actually link them together and know that you want that event to happen when the key by that "name" (i.e. the shift key) is pressed. So the purpose of the parallel event is literally just to check if the shift key is being pressed, and then if so, tell the game what to do (i.e. launch the other common event that actually contains the function you want to happen).

There is more than likely another way to do it with more scripting in a plugin, but that is unfortunately beyond the limits of my knowledge, so someone else would have to step in here 😔 I actually dug around the core .js files for a while looking for whatever code might be needed to do that, but I was way out of my depth and came up empty-handed 😢


EDIT: SCRATCH ALL THAT! I just found another Button Common Events Plugin that's free for non-commercial and commercial games (with credits given), here. So if this works, it would actually bring us back to the beginning where you can avoid having to do any of this keymapping stuff, and avoid having a constant parallel event checking for button presses (although I still don't think it's all that bad). But either way, this plugin is probably the easiest option (and free!), so might as well try it and see how it goes!
The option to call a common event is on the first event command page, here:

Actually, I know that already but it is my fault for not being clearer. Before I try the plugin, I'd like to try the note pad first.

So if I understand correctly, I create a new notepad, end it with JS and inside the note pad type out Input.keyMapper[16] = 'X'
But for the X, what do I place there for a Common event? Is it
Input.keyMapper[16] = 'CommonEvent22' ​

for example?
Actually, I know that already but it is my fault for not being clearer. Before I try the plugin, I'd like to try the note pad first.

So if I understand correctly, I create a new notepad, end it with JS and inside the note pad type out Input.keyMapper[16] = 'X'
But for the X, what do I place there for a Common event? Is it
Input.keyMapper[16] = 'CommonEvent22' ​

for example?
That's not quite how that works. The key mapper just lets you assign a key code to a string you can use to identify it. So in this case, if you were to check Input.isTriggered('CommonEvent22') it would check for the player pressing shift. It's simple an identifying name, it doesn't tie it to a particular event.
That's not quite how that works. The key mapper just lets you assign a key code to a string you can use to identify it. So in this case, if you were to check Input.isTriggered('CommonEvent22') it would check for the player pressing shift. It's simple an identifying name, it doesn't tie it to a particular event.

I know "CommonEvent22" would not work. I asked on purpose to ensure what I was asking for was clear. I would like the code for CommonEvent22. (22 is just an example number)

I want to "tie" Common event 22 into Input.keyMapper[16] = 'X'
I know "CommonEvent22" would not work. I asked on purpose to ensure what I was asking for was clear. I would like the code for CommonEvent22. (22 is just an example number)

I want to "tie" Common event 22 into Input.keyMapper[16] = 'X'
And I'm telling you that you can't do that because that's not how the key mapper works.

You also don't need to add code 16 because it already exists:
1646752961654.png

So you'd need to have your event check for Input.isTriggered("shift") and then in there call $gameTemp.reserveCommonEvent(22)

Original thread: https://forums.rpgmakerweb.com/threads/script-for-changing-button-functions.144620/