Is there a conditional branch that checks if any other button is pressed down?

So I'm working on a chain command mini-game where you have to press down buttons before the time runs out. This is all done through events. The only problem I'm running into is that I want the player to have to go back to a previous button if they mess up the input of the current button they're on.
e.g a conditional branch that says if any button but A is pressed then show a picture.

Is there a way to do this through a script or plugin? Or can this be done through events and I'm just missing it?
It's right in the event commands. Conditional Branch -> Tab 4.
It's right in the event commands. Conditional Branch -> Tab 4.
Maybe I worded the title wrong. I know how to use the conditional branch to check if a button is pressed.

Nonetheless, I think I figured out what to do. If I wanted a show picture command if any button but B is pressed then all I would have to do is multiple conditional branches for every other button that's not B. I feel stupid lol.
Alternatively you could try one of these in Conditional Branch -> Script:
  1. Is any button pressed?

    Object.values(Input._currentState).some(function(p) { return p; })
    You could use this in an else branch if the main button isn't pressed.

  2. Is any button pressed, ignoring the input named "ok"?

    var ignore = "ok", c = Input._currentState; Object.keys(c).some(function(n) { return n !== ignore && c[n]; })
    It'll return true iff there is recognised input that is not the "ok" button. Replace ok with the input name you want to avoid.
Basically these just loop through the current input states (each button has its own "pressed" status) and check if one of them is currently true. The second one has some extra stuff to skip a certain button name.
Alternatively you could try one of these in Conditional Branch -> Script:
  1. Is any button pressed?

    Object.values(Input._currentState).some(function(p) { return p; })

    You could use this in an else branch if the main button isn't pressed.
Would it also work to check, in an else branch, Input._pressedTime<60 ? That would cover if something was pressed in the last second, but it wasn't the desired key, no? Of course adjusting the 60 to the desired precision.

@ATT_Turan - Input._pressedTime can be misleading, since by default it doesn't change when a button is released: it counts up while Input._latestButton is still down, and resets when any button is triggered (i.e. up last frame but down this frame).

E.g. a new input is triggered, held for 30 frames, then released: Input._pressedTime will remain at 30 until another button is pressed.
Ah, I see.
OR you could check for plugins that already do that. theres an (outdated, maybe) plugin from SomeRandomDude, for example, that does that (i think combined with yanflys action sequences): its like some final fantasies monk-like characters commands (FF6s sabin, FF7s tifa,...) where after choosing an action, a prompt appears where you imput the commands shown.
Alternatively you could try one of these in Conditional Branch -> Script:
  1. Is any button pressed?

    Object.values(Input._currentState).some(function(p) { return p; })

    You could use this in an else branch if the main button isn't pressed.

  2. Is any button pressed, ignoring the input named "ok"?

    var ignore = "ok", c = Input._currentState; Object.keys(c).some(function(n) { return n !== ignore && c[n]; })

    It'll return true iff there is recognised input that is not the "ok" button. Replace ok with the input name you want to avoid.
Basically these just loop through the current input states (each button has its own "pressed" status) and check if one of them is currently true. The second one has some extra stuff to skip a certain button name.
Thank you so much! I'm having another issue and was wondering if you could help me out. Using a gamepad with these autorun events, I'm running into an issue. Pressing buttons down leads to extremely inconsistent results and only registers properly when I release the button very quickly. Sometimes I'll press the wrong input and it will bring me back 2 or 3 buttons. Other times, pressing the correct button won't register at all. It's hard to explain, but the issue should be obvious when trying it out.

If you have the time, here is the file for the mini-game. I used the EFG_Baron_GamepadModification plugin to change gamepad controls.

Edit: Updating working link

@EndlessGame - I don't have a gamepad/controller, so I can't test that for you.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-conditional-branch-that-checks-if-any-other-button-is-pressed-down.149687/