How can I prohibit pressing two buttons?

I use the movement behavior in 8 directions. I turned off the diagonal movement there. But, when you press two buttons, the sprite still moves in one of the directions-up, down, right or left.How do I disable pressing two buttons?

Sorry, I didn’t understand. Are you trying to tell that:
If you are pressing up key and object is moving up
After that you press down at the same time, that’s when object stops moving up and goes down
Do you not want that to happen?

Try to disable the default controls then add the keys you want in separated events.


Sorry, English is not my language. If I press the buttons to the right and up (for example), then I want the sprite not to move. So that the movement was one button at a time

You can restrict the movement to only one button with something like this.


This way you’re setting
IF
Up or W are pressed
AND
not pressed Down, Right, Left
THEN
Simulate Up for player

@UlisesFreitas did the right thing. You need to do something like this for all your direction.

I added a variable to the player object and set it to a value when a certain key press was in use. The other keys will not work until the current key is release. I did not use any behaviors. I move my player based on the x and y values.