You can find this sample in the tutorial project: Menu → Keyboard input
This C# Beginner tutorial covers how to handle keyboard input.
We can check for the existence of a keyboard and then we can use various methods to check if a key is pressed, held down or released.
[!code-csharpEntity]