- #1
AliGh
- 64
- 1
I have written a program in C# which presses some keys and do some mouse movements and clicks
Now i want to bind a key to my start and stop buttons (works even if window is not the active window)
I searched in google but got confused . Isn't there any easy way to do this (for example i want Alt + F2 to stop the program)
And also i saw something like this and it didnt work (unless button1.PerformClick(); is the wrong command for hitting a button)
private void Form1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.F8)
{
}
}
Now i want to bind a key to my start and stop buttons (works even if window is not the active window)
I searched in google but got confused . Isn't there any easy way to do this (for example i want Alt + F2 to stop the program)
And also i saw something like this and it didnt work (unless button1.PerformClick(); is the wrong command for hitting a button)
private void Form1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.F8)
{
}
}