
Module Module1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Public Sub HotKey(ByVal hotkey As Boolean)
HotKey = GetAsyncKeyState(Keys.Insert) 'Change to any hotkey
If hotkey = True Then
Button1.Click()
'Do something
'add your code here when the hotkey is pressed
End If
End Sub
End Module


Module Module1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Public Sub HotKey(ByVal hotkey As Boolean)
hotkey = GetAsyncKeyState(Keys.F7) 'Change to any hotkey
If hotkey = True Then
Form1.Timer1.Enabled = True
'Do something
'add your code here when the hotkey is pressed
End If
End Sub
End Module
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
SendKeys.Send(TextBox1.Text)
SendKeys.Send("{Enter}")
HotKey(True)
End Sub

