Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16
Dim maybe1 As Boolean
Dim maybe2 As Boolean
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If GetAsyncKeyState(Keys.F7) Then
Button1_Click(sender, e)
End If
If GetAsyncKeyState(Keys.F8) Then
Button2_Click(sender, e)
End If
End Sub
End Class
Dim maybe1 As Boolean
Dim maybe2 As Boolean
Button1_Click(sender, e)
Declare Function keybd_event Lib "user32" Alias "keybd_event" _
(ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long) As Long
Private Const KEYEVENTF_KEYUP = &H2
Sub PressKey(K as Keys) Call keybd_event(k, 0, 0, 0) System.Threading.Thread.Sleep(20) Call keybd_event(k,0,KEYEVENTF_KEYUP, 0) End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If GetAsyncKeyState(Keys.F7) Then
'Press the required key by using the following line. Use the following statement multiple times to stimulate multiple keys at a time. (Combination)
PressKey(Keys.A)
End If
If GetAsyncKeyState(Keys.F8) Then
'Press the required key by using the following line. Use the following statement multiple times to stimulate multiple keys at a time. (Combination)
'Prints the screen
PressKey(Keys.PrintScreen)
End If
End Sub
End Class