Results 1 to 7 of 7

Thread: Record any key being pressed!!!!!!

  1. #1
    Guest

    Question

    Please help.
    I tried to record keys using GetAsyncKeyState(iKey) but it does not properly works. If anybody know another way or method please let me know. THX

  2. #2
    Guest
    This is how you use the GetAsyncKeyState API function.


    Code:
    Private Declare Function GetAsyncKeyState _
    Lib "user32" (ByVal vKey As Long) As Integer
    
    
    Private Sub Timer1_Timer()    
        Dim iKey As Integer    
        For iKey = 3 To 255       
            If GetAsyncKeyState(iKey) Then Caption = iKey   
        Next 
    End Sub

  3. #3
    Guest

    !!!

    Yes but even that possibility doesn't work properly. You do not receive the exact stringchain you have entered. Try it out!!!!! It is like a puzzle after a while of running!!!

  4. #4
    Guest
    Set the Timer's Interval higher.

  5. #5
    Guest
    I don't have the exact code, but I can give you some pointers. Use Global-wide hooks and the KeyBoardProc Callback. This can track much better than GetAsyncKeyState.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    How about setting the form's KeyPreview property to True. Then you'll get a Form_KeyPress event even if something else has focus.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    Guest

    !!!

    Form_keydown is a good idea but you will receive keys when the form has focus and that is not what i want.

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