Results 1 to 2 of 2

Thread: [RESOLVED] where should i put GetAsyncKeyState at

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Resolved [RESOLVED] where should i put GetAsyncKeyState at

    hey yall when moving something with arrow keys and i call other functions from inside checkplayinput function ,sometimes vb6 will lockup is there a better way or would it be better to put the checkplayinput code in the run function?
    many thanks
    Code:
    Sub Run()
    
        While Running
                Call CheckPlayInput
    
            DoEvents
        Wend
    End Sub





    Code:
    Private Function CheckPlayInput()
        
                   If GetAsyncKeyState(vbKeyUp) < 0 Then
                    
                End If
                
                If GetAsyncKeyState(vbKeyDown) < 0 Then
                     
                End If
                
                If GetAsyncKeyState(vbKeyLeft) < 0 Then
                     
                End If
                
                If GetAsyncKeyState(vbKeyRight) < 0 Then
                     
                End If
       
       
    End Function

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Re: where should i put GetAsyncKeyState at

    ok so i put it inside the run sub seems to work a little beter

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