[Solved] How to make a character to stay on the direction of the last pressed key?

I am just starting few days ago, and still unfamiliar with the condition on the Event. So…
How do i make the character on my game to stay on the direction of the last pressed key?

For Example, if i am walking to left, and stop, i want my character to stay idle facing left.
But my games right now, when i walk in any direction and stop, the sprite will be showing is the one i put the last in the Event

So any suggestion to how to make solve this?

This is my event

Try something like:

Thanks!
it works!
:pray::pray::pray::pray::pray: