Private Property result As Short
Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Integer) As Short
Code:
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
For i = 6 To 255
result = 0
result = GetAsyncKeyState(i)
If GetAsyncKeyState(Keys.Right) Then
End If
If GetAsyncKeyState(Keys.F5) Then
End If
If GetAsyncKeyState(Keys.Left) Then
End If
If GetAsyncKeyState(Keys.F2) Then
End If
Next i
End Sub
@AxiomFlux - your *first* bug described, the "printing of the time" thing...is an error with SendKeys(). This is too large of a project / too many possible errors to comment further.
Originally Posted by Pingo
Put an example of what you're writing in the textbox.
Also 2 timers isnt needed plus GetAsyncKeyState is a boolean in itself.
These arnt needed
Code:
Dim Hotkey1 As Boolean
Dim Hotkey2 As Boolean
Dim Hotkey3 As Boolean
This on one timer should work
Code:
If GetAsyncKeyState(Keys.F5) Then
SendKeys.Send("{Enter}")
SendKeys.Send(TextBox1.Text)
SendKeys.Send("{Enter}")
End If
If GetAsyncKeyState(Keys.F6) Then
SendKeys.Send("{Enter}")
SendKeys.Send(TextBox2.Text)
SendKeys.Send("{Enter}")
End If
If GetAsyncKeyState(Keys.End) Then
Close()
End If