A simple way to disable the button for a while?

Good day!

When the text appears on the screen, it does not appear at once, but if you press the space bar once more, it will be displayed in its entirety at once. I would like to make it so that the player for a time can not do this. Other than somehow disable the space bar, nothing else comes to mind. Is there an easy way to do this?
there should be a text code for "do not react to player input" in the show text textcodes, but i never tested if that blocks speedup as well as action button
If you're using Yanfly's Message Core, there are plugin commands to disable/enable fast forwarding. You may want to do it that way as the plugin offers a lot of functionality that could be useful in your game.

If you don't want to do that, you can copy the below code into a text editor, save as a *.js file, include it as a plugin:
Code:
Scene_Map.prototype.isFastForward = function() {
    return ($gameMap.isEventRunning() && !SceneManager.isSceneChanging() &&
            (Input.isLongPressed('ok') || TouchInput.isLongPressed()) && !$gameSwitches.value(X));
};
where X is the ID of a game switch (no leading zeros).

You'll then be able to control fast forwarding during your game by turning that switch on or off.

there should be a text code for "do not react to player input" in the show text textcodes
I only see do not wait for player input, which would close the window automatically but not ignore fast forward. Unless I misunderstand you.

ATT_Turan,​

Andar​

Sorry, I think I misspoke. I do not mean that the text when the player holds the "space bar" (and the text flies faster). For example, there is a very long text, but it does not appear immediately, the longer the text the longer it will be printed on the screen and if you turn off the fast forward and the player quickly pressed the space bar twice, it will still instantly appear completely. It is this effect I want to remove for a while.
We understood what you wanted, I was just looking in the wrong place.

Interestingly, Yanfly's Message Core does not correctly disable this, as I would expect. I might make a patch for that.

Regardless, instead of what I gave you above, use this:
Code:
Window_Message.prototype.updateShowFast = function() {
    if (this.isTriggered() && !$gameSwitches.value(X)) {
        this._showFast = true;
    }
};
again, replacing X with the ID of a switch. When that switch is on, the player can't skip text. It works for me in my test project.

ATT_Turan​

It works just the way I wanted it to! Thank you so much! : )

Original thread: https://forums.rpgmakerweb.com/threads/a-simple-way-to-disable-the-button-for-a-while.157930/