The problem is that the second parameter after the
Input command, the output variable (the parameter
command, in your script), only outputs characters, not hotkeys that don't produce a (visible?) character. And
^j does not produce a character, it's just a hotkey. From the
documentation:
OutputVar does not store keystrokes per se. Instead, it stores characters produced by keystrokes according to the active window's keyboard layout/language. Consequently, keystrokes that do not produce characters (such as PageUp and Home) are not stored (though they can be recognized via the EndKeys parameter below).
The proper command to use in your script would probably be the
Hotkey command, to create temporary hotkeys, rather than the Input command. But it can still be done with the
Input command if you use
A_ThisHotkey instead of the output variable. This works for me:
Code: Select all
^j::
input, command, L1 M T5
if (A_Thishotkey = "^j" or command = "j")
{
send, ^d
Sleep 10
send, !s16
send, !ct{enter}
}
else if (command = "2" or command = "k")
{
send, ^d
Sleep 10
send, !s14
send, !ct{enter}
}
else if (command = "3" or command = "l")
{
send, ^d
Sleep 10
send, !s12
send, !ct{enter}
}
;send, {down}
Return
I've also added the option
M to the
Input command, or it didn't work. Lastly, I've corrected an error in your code:
T5 is an option just like
L1 and
M, and all options are one parameter together, so there shouldn't be a comma between any of them.
(I've also flagged this post to be moved to the "Ask for Help" forum.)