Pressing a button to end an event

I'm making a mini-game in which the player will be prompted to press the okay button to stop a cursor arrow that is jumping between different choices.


I can do most of this by having the event place the cursor in different locations on the screen depending upon a randomly generated number. I can even make this event run for as long as the player holds a button down, then ends on release.


However, I'd prefer to make it so the player presses the button to stop the event, not releases it.


I'm thinking I can do this by placing the "if button press" conditional between every command, but I'm wondering if there's a better way that's just not occurring to me...


Thanks in advance!


EDIT: Okay, so I cheesed it by making a loop that checked for a button press every frame while allowing me to change one number to determine how many frames the cursor arrow would stay on each choice for. This is usable, but it feels janky, so if anyone has a better method, I'm listening. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/pressing-a-button-to-end-an-event.59986/