|
Description
Describing the "GetASyncKeyState" function.
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer 'Declare the function Private Sub Timer1_Timer() If GetAsyncKeyState(vbKeyA) The 'Searches for the keypress of the A button. msgbox "You pressed the A button", vbInformation + vbOkOnly, "Keypress detected" End If end sub 'An ordinary keypress takes 60 - 70 milliseconds, so that is what my timer is set to, 'BUT, if you were to hold down, in this case "A", AND, let's say, when you press A, it would open "explorer.exe" 'It would open "explorer.exe" once every 60 - 70 milliseconds, that's alot of windows. 'Alin Coop 2008 |
|