mikemuska Posted March 7, 2014 Posted March 7, 2014 I'm kinda new to the whole scripting thing and im trying to make a script that holds the X key when i press ctrl+g and then press it again to make it stop. I don't even really know where to start. Also if possible I want to make it into a exe
jguinch Posted March 7, 2014 Posted March 7, 2014 So what did you try ? Did you have a look at the documentation ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
mikemuska Posted March 7, 2014 Author Posted March 7, 2014 So what did you try ? Did you have a look at the documentation ? I tried Send("{x down}") ;Holds the x key down Send("{x up}") ;Releases the x key" and a few other lines of code i found on the forums but they were for different tasks and didn't work and documentation?
Moderators JLogan3o13 Posted March 7, 2014 Moderators Posted March 7, 2014 What kind of window are you trying to manipulate with your Sends? There is most often a much better way of accomplishing what you're trying to do. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Solution mlukac89 Posted March 7, 2014 Solution Posted March 7, 2014 Global $run = False HotKeySet("^g", "_start") While 1 Sleep(100) WEnd Func _start() $run = Not $run While $run If $run Then Send("{x down}") Else Send("{x up}") EndIf WEnd EndFunc Is this helps ? just compile it
mikemuska Posted March 8, 2014 Author Posted March 8, 2014 Global $run = False HotKeySet("^g", "_start") While 1 Sleep(100) WEnd Func _start() $run = Not $run While $run If $run Then Send("{x down}") Else Send("{x up}") EndIf WEnd EndFunc Is this helps ? just compile it Big thanks worked perfectly only thing I changed was the ^g because it was bugging out my keyboard when used that hotkey.
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