I am making a program to record the position of a mouse when someone presses the Space button.
This works fine, however when I put the cursor in any textBox in the form the code becomes useless of course because the space gets typed in the textBox. I tried to change the focus() or try other keys like LeftWin ... but none worked!
Any advice on how can I detect the Space button (or any other key) all the time in a form?
private void lebel1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Space)
{
//bla bla
}
}