Custom Step Counter Move all

I want to count the steps at some point in the game. (not the total amount of steps)
I created four conditional branches. Everyone of them checks if a certain direction key is pressed.
but thats where my problem lies. I tried to use wait commands but it doesn't really help. If you hold a key the count goes higher then it should. Because it counts as long as you hold the button not just one press and release.
Is there some Move all command, like in the RPG-Maker 2000 where the event waits as long something is moving on the screen?
Instead of doing it based on how long the button is pressed, do it through change of actor's X or Y coords.
Could you give me a bit more information: Do you want to count the total number of steps at a from point A to point B? Or are you saying you just don't want the total number of steps in the game?

Also, Poryg has a really good solution too.
Calculating from A to B is complicated, because it needs a pathfinding feature. Not to mention, there are things like going back, going up... Which doesn't help you if you want to count the precise steps taken for, for example a custom programmed random encounters.
If he just wants to calculate steps later on in his game; I made a plugin that calculates steps taken in RPGMakerMV.

Original thread: https://forums.rpgmakerweb.com/threads/custom-step-counter-move-all.81384/