Ipooptoomuch Posted June 18, 2006 Posted June 18, 2006 (edited) Hello, I am writing a program that must hold down alt at all times but must let go of alt whenever I press s, or left click. I am not sure how to accomplish this, please help. I can't think of a way to use hotkeyset to do this.EDIT FOR SECOND QUESTION: Ok I just tested the other part of my program and it disables keys that are hotkeyed, can I fix this? This program is just supposed to make my tyghv and b keys substitute for my corresponding 78451 and 2 keys on my numpad for warcraft 3 hotkeys.$toggle=0$exit=0$x=1hotkeyset ("_","kill")hotkeyset ("+","reset")hotkeyset ("{ENTER}","toggle")hotkeyset ("t","send7")hotkeyset ("y","send8")hotkeyset ("g","send4")hotkeyset ("h","send5")hotkeyset ("b","send1")hotkeyset ("n","send2")func toggle() if $toggle=1 Then $toggle=0 else $toggle=1 EndIfEndFuncfunc send7() if $toggle=1 Then send ("{NUMPAD7}") EndIfEndFuncfunc send8() if $toggle=1 Then send ("{NUMPAD8}") EndIfEndFuncfunc send4() if $toggle=1 Then send ("{NUMPAD4}") EndIfEndFuncfunc send5() if $toggle=1 Then send ("{NUMPAD5}") EndIfEndFuncfunc send1() if $toggle=1 Then send ("{NUMPAD1}") EndIfEndFuncfunc send2() if $toggle=1 Then send ("{NUMPAD2}") EndIfEndFuncfunc reset()$toggle=0EndFuncfunc kill() $exit=1EndFuncdo sleep (1000) if $exit=1 Then Exit EndIfuntil $x=0 Edited June 18, 2006 by Ipooptoomuch
Moderators SmOke_N Posted June 18, 2006 Moderators Posted June 18, 2006 You should lay off the ex-lax 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.
Paulie Posted June 18, 2006 Posted June 18, 2006 (edited) Hello, I am writing a program that must hold down alt at all times but must let go of alt whenever I press s, or left click. I am not sure how to accomplish this, please help. I can't think of a way to use hotkeyset to do this.EDIT FOR SECOND QUESTION: Ok I just tested the other part of my program and it disables keys that are hotkeyed, can I fix this? This program is just supposed to make my tyghv and b keys substitute for my corresponding 78451 and 2 keys on my numpad for warcraft 3 hotkeys.One thing to do is change your Do/Until loop you have at the bottom into a While/Wend loop, its just more reliable for a default action, not that yours was incorrectHotKeySet Steals keys for other uses, look into "_IsPressed" in the helpfile (I think its there) Edited June 18, 2006 by Paulie
dandymcgee Posted August 13, 2006 Posted August 13, 2006 Well after typing: hotkeyset ("{ENTER}","toggle") If you type: hotkeyset ("{ENTER}") Is should turn off enter as a hotkey, then just retype: hotkeyset ("{ENTER}","toggle") to restore enter as a hotkey. Hope I helped - Dan [Website]
Zib Posted August 13, 2006 Posted August 13, 2006 Hello, I am writing a program that must hold down alt at all times but must let go of alt whenever I press s, or left click. I am not sure how to accomplish this, please help. I can't think of a way to use hotkeyset to do this. For Q#1. #Include <Misc.au3> Opt("OnExitFunc","OnAutoItExit") Send("{LALT DOWN}") While 1 If _IsPressed(53) Or _IsPressed(01) Then Send("{LALT UP}") Do Sleep(10) Until _IsPressed(53) = 0 And _IsPressed(01) = 0 Send("{LALT DOWN}") EndIf WEnd Func OnAutoItExit() Send("{LALT UP}") EndFunc
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