Jump to content

Holding Down X Script


Go to solution Solved by mlukac89,

Recommended Posts

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

Link to comment
Share on other sites

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?
Link to comment
Share on other sites

  • Moderators

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...