PDA

Click to See Complete Forum and Search --> : Keypress check is true for previous hit


mdean
Oct 3rd, 2000, 11:39 AM
Hi,

I don't know what the hell I'm doing wrong but I get true results for key checks when the keys weren't pressed. I've tried using getkeystate with the &H8000 and I'm still getting trues in my timer loop. Can anyone give me a quick solution to this ridiculous nightmare? If it makes a difference, I'm checking for key hits while the browser control is loading documents. I have a web app that needs to buffer keystrokes when the browser is busy.

Thanks for your help,

Mike

Oct 3rd, 2000, 02:05 PM
If you are using the GetAsyncKeyState api function, than you should start at 3 since 0-2 are part the mouse.

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 i As Integer
For i = 3 To 255
If GetAsyncKeyState(i) Then Debug.Print Chr(i)
Next
End Sub