How to add button input to dodge on map enemies?

I want to add a feature to my on map enemy encounter system that gives you an opportunity to dodge the battle by pressing a key at a certain time but I have no idea how I could do this?

Thanks in advance for any help.
I would imagine in your map-enemy event, have a button-press check condition before the Battle Processing? Depends on how exactly you want to do it... Could also make it switch-reliant before or after the button-press check, like if an ability allows you to dodge these encounters.
First define how that map encounter system works... 🙂
I used Akons/HK tutorial added Proximity and Line of sight to the events.

I want to be able to press X or enter when the Exclamation Balloon pops up and if done right or a random button input and if the player gets the right button the player could dodge the battle.
I used Akons/HK tutorial added Proximity and Line of sight to the events.
That is not "defining how the map encounter system works". If you don't want to explain how you have your events set up, or provide a screenshot so we can see, at least provide a link to the system you're talking about. If you want others to help you, don't make them go trudging around the internet looking for some obscure system you've referred to 🙂
Well, in whatever event that determines the layer is going to go into battle you'll add a conditional branch first that checks if a button is being pressed. If so, exit event processing. If not, enter battle.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-button-input-to-dodge-on-map-enemies.20571/