First of all a Form in Visual Studio is a Window. So if the form is out of focus it means the window is not selected.
As a beginner you can use the Events tab (in the properties of the window). You can use the KeyUp, KeyPress, KeyDown events and use "case" to set different roles to different key presses.
I hope this was helpful.