Firstly, please understand that I have zero knowledge about coding and programming.
I can't understand what every single line does so please bear with me.
I have been looking for triple action (Single tap, Double tap, Hold) shortcut mapping method that I can easily tweak and assign with AHK and I have finally found this amazing solution.
https://superuser.com/questions/1838305/this-single-double-and-hold-ahk-script-is-not-working?newreg=ad80262a205c4bb0b5038afc185a8f2f
It is almost perfect but one issue is that I can't use modifier keys as mainKey.
For Illustrator, There's a lot of limits when it comes to customizing shortcuts.
Some of them are hard coded which I can't change at all and it doens't even allow me to use cntl or alt keys for Tools' shortcuts.
What I am trying to do is, I assign shortcut "Shift+1" to Selection Tool, "Shift+2" to Lasso Tool and mapping the shortcuts with AHK.
Like, when pressing "Cntl+Space", it triggers "Shift+1" so I can use Selection Tool and "Cntl+Double Tap Space" for "Shift+2" which is Lasso Tool.
This way, I can use Cntl key for Tools.
Code: Select all
TripleBind(mainKey, msec, singleKey, doubleKey, holdKey)
{
ProcessPress(key)
{
static count := 0
held := true
++count
AfterTime()
{
if (held) {
Send holdKey
} else if (count == 1) {
Send singleKey
} else {
Send doubleKey
}
count := 0
}
if (count == 1) {
SetTimer AfterTime, -1 * msec
KeyWait mainKey
held := false
}
}
Hotkey "$" . mainKey, ProcessPress
}
TripleBind("space", 300, "Numpad1", "^+!v", "+q") ---This works fine
TripleBind("^space", 300, "Numpad2", "^+!b", "+w") ---This doesn't work
With the script I can assign any keys with modifier keys (i.g ^+!v, +q, etc.) for the singleKey, doubleKey and holdKey, but I can't assign them for mainKey. mainKey seems to work with only a single key without modifer keys.
I need the mainKey works with any modifier keys (cntl, alt, shift or all of three at once)
What parts should be added or modified to achieve it?
I really appreciate your time.