Results 1 to 2 of 2

Thread: Keypress check is true for previous hit

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    4
    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

  2. #2
    Guest
    If you are using the GetAsyncKeyState api function, than you should start at 3 since 0-2 are part the mouse.

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width