
Originally Posted by
LaVolpe
Several methods
1. Use GetKeyboardState API
2. Use GetAsyncKeyState API
3. Use a keyboard hook: SetWindowsHookEx API
thanks... the 1st resolved my problem
and it's importanted put these function:
Code:
Public Function DetectSelectedKey(Key As Long) As Boolean
If GetKeyState(Key) < 0 Then
DetectSelectedKey = True
Else
DetectSelectedKey = False
End If
End Function
the objective of these funcion it's for tell us if the key is pressed.
and for see if any key(in these case we don't care what key was pressed) was pressd, use the keypress event. but the special keys(like arrow keys and the others special keys) don't work, then use the keydown event with 1 boolean variable for call it 1 time