I set Timer Interval = 1 and I use IF Statements as there is no way to get keys without it. just check...
For a start, you could certainly make the code shorter by using one or more loops. For example...
- Dim I As Long
-
Const Pressed As Integer = -32767
-
For I = vbKeyA To vbKeyZ
-
If GetAsyncKeyState(I) = Pressed Then
-
Text1.Text = Text1.Text & Lcase(Chr(I))
-
End If
-
Next
I believe there are third-party timer controls available that can fire more rapidly than the VB-supplied one. For more precise timing (or just faster checking) you could also set up an infinite loop which simply keeps on checking non-stop. Until you
want it to stop, obviously.
It might be worth double-checking the comparison you're performing, too. For instance, didn't the doco say that the shift state is also encoded in there? If so, -32767 might miss things. Might be better to use AND to check specific bit positions.