Sorry for bumping this, I didn't want to start another topic (and the problem is relevant to the original question anyway). So, how am I supposed to "filter" input? I mean, at the moment, I control the character with the arrow keys. If I press, for example, down and right, the character moves diagonally. But I'd like to avoid this, and limit the character movement to only horizontal or vertical.
Here's an example what I've tried so far: When the up or down arrow is pressed, I made a test do determine wether the left or right arrow is pressed, and only started to move the character when neither of they were pressed. I did the same for left and right. This worked, but not as expected, as there is no way to change direction until the original key has been released.
In RPG Maker, the system I'd like to recreate, when the player holds down a key and the character starts to move, pressing another direction key will overwrite the first one, but the first one will remain in the input buffer until released. For example, if I hold down right arrow, the player moves to the right, but if I press up arrow (while holding down right arrow), the character will move up immediately, thus the system ignores if the previous key is down or not. If I release up arrow (while still holding right arrow), the character will move to the right, I don't have to release and hold right arrow again.
Sorry if it wasn't clear what I'd like to achive, but could someone shed some light on this?
Thank you.