Click to See Complete Forum and Search --> : GetAsyncKeyState() Problem...
Arie
Jul 30th, 2001, 02:11 AM
Hi, Guys!
How can I set false all the GetAsyncKeyState() keys?
Sometimes I get some True values...
I want something like reseting all keys...
Thank you,
Arie. (mag.up.co.il)
Aaron Young
Jul 30th, 2001, 08:56 PM
You can't reset the "GetAsyncKeystate()" value, (although I suppose you could use the "SetKeyboardState()" API, but it's unnecessary.)
If you're just concerned with the inital spurt of key state triggers you can get starting an application, then just do something like this when your application starts:Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
Dim lKey As Long
Do While lKey < 256
For lKey = 0 To 255
If GetAsyncKeyState(lKey) Then Exit For
Next
DoEvents
Loop
End Sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.