Im new to WPF and C#. I try to create a 2d Pong Game and need to process key input from two person at the same time. At this time i can process one input at the time and other inputs are blocked.

XAML Code:
C# Code:
Try setting a flag in Rectangle_KeyDown that sets the state of the keys, or the rectangles speed/direction.
Then in your main loop MoveBall, update the rectangle position based on the state or speed. Then you have to handle KeyUp to make sure to remove the state/speed when you release the key.
That way, you are only changing the state when you press keys. The main loop is handling the actual updating.
That‘s a nice way. Thanks for the reply i will try it 🙂
C# devs
null reference exceptions

source