PDA

Click to See Complete Forum and Search --> : Record any key being pressed!!!!!!


Jan 9th, 2001, 03:44 PM
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

Jan 9th, 2001, 07:08 PM
This is how you use the GetAsyncKeyState API function.


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

Jan 13th, 2001, 05:37 AM
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!!!

Jan 13th, 2001, 11:37 AM
Set the Timer's Interval higher.

Jan 13th, 2001, 05:36 PM
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.

parksie
Jan 13th, 2001, 05:45 PM
How about setting the form's KeyPreview property to True. Then you'll get a Form_KeyPress event even if something else has focus.

Jan 16th, 2001, 11:57 AM
Form_keydown is a good idea but you will receive keys when the form has focus and that is not what i want.