damirsel
asked on
GetAsyncKeyState with no repeat
Hello.
I am trying to make a program wich will register every pressing of A,B,C keys but I need do detect these keys exactly with no repeating i try this way:
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyA) Then Label1.Caption = Label1.Caption + "A"
If GetAsyncKeyState(vbKeyB) Then Label1.Caption = Label1.Caption + "B"
If GetAsyncKeyState(vbKeyC) Then Label1.Caption = Label1.Caption + "C"
End Sub
Timer.interval=100
there is a problem when user hold down some of keys it continues to write that key in label.
Is there a way to detect a global KeyUp property with GetAsyncKeyState and avoid this problem?
Thanks.
I am trying to make a program wich will register every pressing of A,B,C keys but I need do detect these keys exactly with no repeating i try this way:
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyA) Then Label1.Caption = Label1.Caption + "A"
If GetAsyncKeyState(vbKeyB) Then Label1.Caption = Label1.Caption + "B"
If GetAsyncKeyState(vbKeyC) Then Label1.Caption = Label1.Caption + "C"
End Sub
Timer.interval=100
there is a problem when user hold down some of keys it continues to write that key in label.
Is there a way to detect a global KeyUp property with GetAsyncKeyState and avoid this problem?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.