AHK sends the key held in the "down" variable,

I want to send a key that is being held down in a variable. The reason it is stored in a variable is because I am using the gui for the user to enter the key.

This currently works:

Send %hotkey%

      

But this is not the case:

Send {%hotkey% down}

      

How can I make it right?

+3


source to share


1 answer


Try this code:

Version 1:

hotkey := "n"
Send {%hotkey% down}

      



Version 2:

!^z::
    hotkey := "n"
    Send {%hotkey% down}
return

      

Make sure it's n

enclosed in ""

. Wrapping any text in ""

means that you are assigning it as a text string. And the variable used in the command Send

must contain a text string.

+1


source







All Articles