W and A keys override S and D Keys
The W and A keys seem to be dominant. For example, if you hold down W then hold S(while still holding W) you keep going forward at the same speed instead of stopping. The same goes for the A and D key. If you hold A and then D, you keep going left instead of stopping. This is set to low priority because it might not cause many troubles, but I thought it might not be intended.
#2 Updated by Alexander Nadeau 5 months ago
There are three normal ways of handling inputs the "point" in opposite directions:
1: Null the input if both keys are pressed. The same as if you were using WASD to emulate an analog stick. Pressing AD at the same time would center the horizontal stick, not pick some direction.
2: Null input cancelling. Pressing and holding A, then pressing and holding D, will result in "right" being detected. Releasing D will then give you the "left" input that you've been holding this entire time. When both keys are depressed, the most recently pressed one is used, otherwise any pressed one of the two is used. However, this is typically not implemented with a queue or stack, just by using a state system for inputs instead of checking which ones are pressed each frame, and having appropriate logic.
3: When it's part of the game logic. Sometimes holding left and right at the same time isn't the same as holding just one of them or neither, but has its own special state, like having higher or lower friction than not pressing anything at all, but not having any acceleration.
#4 Updated by Alexei Dobrohotov 29 days ago
- Status changed from New to Confirmed
- Assignee set to Alexei Dobrohotov
- Reproducibility changed from Have not tried to Always
- Operating system changed from Windows to Other
A_MoveLeft and A_MoveForward actions take priority over A_MoveRight and A_MoveBackward actions in the keyboard movement code. Joystick movement which works the same way is fine, because you obviously can't hold the stick in two directions simultaneously. I have some ideas.