Vb (hotkey) HelpWhen i try to make a hot key i get this error: Compile Error: Sub Or Function not Defined I put this code in timer at interval 1: Code: Private Sub Timer1_Timer() If GetKeyPress(vbKeyAButton) Then Shape1.BackColor = &HFF& End Sub
Originally Posted by redarr When i try to make a hot key i get this error: Compile Error: Sub Or Function not Defined I put this code in timer at interval 1: Code: Private Sub Timer1_Timer() If GetKeyPress(vbKeyAButton) Then Shape1.BackColor = &HFF& End Sub try this way -----put interval to "100" Code: If GetKeyPress(vbKeyControl) And GetKeyPress(vbKeyD) Then Command1_Click End If
Originally Posted by redarr OMFG... It WONT WORK I h8 my Self Same Prob What doesn't work?!, and don't me emo, thats my job -_-.
Make sure your timer interval is 1 and use this code: Code: Private Sub Timer1_Timer() If GetKeyPress(vbKeyA) Then Shape1.BackColor = &HFF& End If End Sub
Originally Posted by suticox OMG lol vbKeyAButton doesnt exist use vbKeyA then use this way Code: If GetKeyPress(vbKeyControl) Then and put u r call write here
lol, have u declared the API? If not on top of the code: private declare function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer