Input._currentState

Hello, spanish is my native language, sorry for my bad english, as well, I am new here so I don´t really know if this is the correct place to post this, but I need help with this script. (RPG MAKER MV)

I´m working in a android game, so I have some touchable buttons on the screen. When you press the button on the screen, it runs a conditional branch in a parallel event like this:

If SceneManager._scene.isPressed('left');
then do: Input._currentState['left'] = true;
then: Wait 1 frame
then: Input._currentState['left'] = false;


So the main character should move left once the virtual button is pressed, but the issue is that the character never stops going left, even if I use the script Input._currentState['left'] = false;

I know that this second script (Input._currentState['button'] = false😉 works because, I´m using it in another button to interact with NPC´s.

If SceneManager._scene.isPressed('ok');
then do: Input._currentState['ok'] = true;
then: Wait 1 frame
then: Input._currentState['ok'] = false;

And it works perfectly (as well with the "cancel" action), it doesn´t go on a endless loop like when I try to do the same with the directional buttons.

I already tried different things like adding another 1 frame wait at the end, also tried to add this "end event processing" in the event commands, but it keeps going in a loop.

I´m not a master in this "script" things, so if any one could help me, I´ll be very grateful.

Thanks

UPDATE

Found this in the rpg_core.js file


/**
* Clears all the input data.
*
* @ static
* @method clear
*/
Input.clear = function() {
this._currentState = {};
this._previousState = {};
this._gamepadStates = [];
this._latestButton = null;
this._pressedTime = 0;
this._dir4 = 0;
this._dir8 = 0;
this._preferredAxis = '';
this._date = 0;
};

But I´m completely lost here, I don´t know how to use it.

I've moved this thread to Javascript Support. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/input-_currentstate.133392/