I have a little program in vb.net that would automate mouse click at certain coordinate on the screen that I use for a game. The problem that I'm having is how to stop this program. once it runs, I just can't stop it, I had to do CTRL ALT DEL to kill it.
I was trying to use this
Private Sub form1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.F1 Then
If e.KeyCode = Keys.F2 Then
but it turns out that the mouse need to be on the form for these keyboard to work. Is there a way I can accomplish this without having to move the mouse to the form?