lopolop Posted November 19, 2005 Share Posted November 19, 2005 i am trying to figure out _Ispressed some help with what _IsPressed does like what is the .dll i need(the user 32 or waht ever) because i have a func that runs a loop when you press e(hotkey) and i want that loop to stop if e _IsPressed again... While 1 MouseClick("Right") Sleep(314) If _IsPressed("45") Then ExitLoop EndIf WEnd i am getting error... _IsPressed(): undefined function. any help would be great --Thanks Link to comment Share on other sites More sharing options...
Zedna Posted November 19, 2005 Share Posted November 19, 2005 _IsPressed is here Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 19, 2005 Moderators Share Posted November 19, 2005 #include <Misc.au3> Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
lopolop Posted November 19, 2005 Author Share Posted November 19, 2005 ok thanks but i got another problem see my hotkey is E and so is my way to stop.. is there a way for me to say when E _ispressed (1st time the hotkey will know longer work... and when it is hit the second time Activate it again other wise the loop wont stop because it will exit loop and run func again... Link to comment Share on other sites More sharing options...
BigDod Posted November 19, 2005 Share Posted November 19, 2005 ok thanksbut i got another problem see my hotkey is E and so is my way to stop..is there a way for me to say when E _ispressed (1st time the hotkey will know longer work... and when it is hit the second time Activate it again other wise the loop wont stop because it will exit loop and run func again...Why not just use HotKeySet. There is an example in the help file which pauses/unpauses a script. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
lopolop Posted November 19, 2005 Author Share Posted November 19, 2005 i dont want to pause my whole script... i just want my hotkey to be like a light switch cilck it.. turns func on... click it agian turns func off... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 19, 2005 Moderators Share Posted November 19, 2005 Well you could make it easy on yourself and change your hotkey!! Or, what about using upper and lower case "e" options, using: #include <Misc.au3> HotKeySet(Chr(101), "Test") While 1 If _IsPressed(45) Then MsgBox(0, "", "Loop") EndIf WEnd Func Test() MsgBox(0, "", "HotKey") EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
lopolop Posted November 19, 2005 Author Share Posted November 19, 2005 well that makes it so i have to press Shift e... i guess ill just do it this way though... i just think it owuld be easier for the user to e to start e to end... Link to comment Share on other sites More sharing options...
brotherhobbes Posted November 19, 2005 Share Posted November 19, 2005 here's a nice little toggle i wrote awhile back. when the user presses capslock, it starts the script. because of the capslock light, you also get a visual indicator of when the script is running. because you don't want to accidently stART TYPING LIke this when the script is running, whenever you press enter the script also toggles the all caps off until you press enter again. if you don't want to use capslock for the toggle, just modify this to whatever you need. expandcollapse popup; set initial values AutoItSetOption("SendAttachMode", 1) AutoItSetOption("SendCapslockMode", 0) Send("{CAPSLOCK off}") HotKeySet("{CAPSLOCK}", "Toggle") $bToggle = 0 ; main loop While 1 If $bToggle = 1 Then ; ;code to toggle goes here ; EndIf Wend ; called when user presses capslock Func Toggle() If $bToggle = 0 Then $bToggle = 1 HotKeySet("{CAPSLOCK}") Send("{CAPSLOCK on}") HotKeySet("{CAPSLOCK}", "Toggle") HotKeySet("{ENTER}", "Enter") Else $bToggle = 0 HotKeySet("{CAPSLOCK}") Send("{CAPSLOCK off}") HotKeySet("{CAPSLOCK}", "Toggle") EndIf EndFunc ; called when enter is pressed, but only if toggle is on Func Enter() $bToggle = 0 HotKeySet("{CAPSLOCK}") Send("{CAPSLOCK off}") HotKeySet("{CAPSLOCK}", "Toggle") HotKeySet("{ENTER}") Send("{ENTER}") EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now