Button input processing problem

I remember in old rpgmaker versions, button input processing was handled in a completely different way.


Basically, you could say to the program "this happens when this key is pressed. If the user keep pressing the key, ignore that". Rpgmaker checked if the user tapped a key first, not whether the key was still being pressed or not. For example, to quickly read dialogues you needed to quickly tap X, whereas with MV you can keep pressing X and the dialogues will scroll autmatically.


I hope I explained myself properly... For me, this change is very annoying because it made making custom menus with events 200% more difficult.


I was wondering if there was a way to revert to the old button input processing using a script, or if anyone has general tips for handling the new one.
What kind of problems are you having? You gave an example, but it had nothing to do with evented menus.
What kind of problems are you having? You gave an example, but it had nothing to do with evented menus.

Well, for example, if you need to press X to open a menu, and X again to select a choice, it's possible to open it and immediately select the first choice if you keep the X key pressed long enough. I put a wait command after the button check to add a little delay, but keeping the button pressed or quickly tapping it will still screw things up.


I'll try to be more clear and make an example! Hopefully my English will be understandable.


In old rpgmaker versions, you had this:


OGxNN6h.jpg



I made a little example to show how things worked.


I made a parallel process that cecks whether the SHIFT key is pressed. If it's pressed, it turns on a switch. If SHIFT is pressed again, it turns it off.


Simple, right?


Ys3HyAg.png



With the "Wait until key pressed" option checked, this happens:


Ym8Y9T6.gif



Even if I keep the SHIFT key pressed, the switch doesn't change until I raise my thumb and press SHIFT again.


Without the "Wait until key pressed" option checked, this happens - and it's the standard rpgmaker MV behaviour:


YfoV7dr.gif



If I keep the SHIFT key pressed, the switch continuously goes ON and OFF and the character keep flashing. No good!


Now, I don't know much about Javascript, but I tried calling this function from the core scripts just after the button check:


wynhtPM.png
p21Vf6v.png



The result:


yDdPCxV.gif



It works... For a few seconds. If I keep the key pressed, the standard flashing behaviour occours.


I see functions related to long presses, repeated key presses etc in the core script, so I think I just have to understand the right function to use at the right moment. Think you can help?


Sorry for the messy explaination.
That option has not existed since RMXP. You'll need to use a parallel process for manually checking until a key is pressed, or a script to handle that.
Events by default use "is pressed" logic when checking for key pressing.


There is another key press check called "is triggered" which only cares about the first time the key was pressed.


You can achieve that by using a formula as your conditional branch


Input.isTriggered("BUTTON NAME")




The names of the buttons depend on what plugins you have in your project.


Here is a reference you can use for the default buttons.
Events by default use "is pressed" logic when checking for key pressing.


There is another key press check called "is triggered" which only cares about the first time the key was pressed.


You can achieve that by using a formula as your conditional branch



Input.isTriggered("BUTTON NAME")




The names of the buttons depend on what plugins you have in your project.


Here is a reference you can use for the default buttons.

Oh, I see! Such a simple solution. And I see in the core scripts there are also functions for checking if a key is being long pressed/repeated, so I imagine there are many ways to manage key input processing using scripts. Good to know!


Thank you ^^

That option has not existed since RMXP.


I completely skipped VX because I didn't like it. Now I have one more reason to hate it 😛

Original thread: https://forums.rpgmakerweb.com/threads/button-input-processing-problem.66268/