Code:
Private Declare Function GetAsyncKeyState _
Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
Dim iKey As Integer
For iKey = 3 To 255
If GetAsyncKeyState(iKey) Then Debug.Print Chr(iKey)
Next
End Sub
Capture certain keys:
Code:
If GetAsyncKeyState(vbKeyA) Then Debug.Print "A pressed"