AHK-v2-script-converter
AHK-v2-script-converter copied to clipboard
Hotstring, hard to tell if it is label, function or hotstring
A possible problem when converting the Hotkey command, it does not understands that the second command is pointing to a Key. WheelUp should need to become quoted "WheelUp". I could check if the second parameter is a valid hotkey, but the string DoubleUp is also a valid hotstring...
I am tending to accept this error for now, the rest seems to be working ok. This will notice the user with an error.
input:
NumpadAdd::
Hotkey, If, MouseIsOver("ahk_class Shell_TrayWnd")
if (doubleup := !doubleup)
Hotkey, WheelUp, DoubleUp
else
Hotkey, WheelUp, WheelUp
return
DoubleUp:
Send {Volume_Up 2}
return
Result:
NumpadAdd::
{ ; V1toV2: Added bracket
Hotkey("If", MouseIsOver("ahk_class Shell_TrayWnd"))
if (doubleup := !doubleup)
Hotkey("WheelUp", DoubleUp)
else
Hotkey("WheelUp", WheelUp)
return
} ; Added bracket before function
DoubleUp(ThisHotkey)
{ ; V1toV2: Added bracket
Send("{Volume_Up 2}")
return
} ; V1toV2: Added bracket in the end
i dont believe this line Hotkey, WheelUp, WheelUp
is valid v1 code anyway. there is no WheelUp
label
in the documentation it is converted as Hotkey("WheelUp", "WheelUp"), so probably interpreted as a sendInput... I think I will add a folder of examples that currently are not correct translated, but skipped at the moment
Where in the docs? I'm not seeing it on the Hotkey command page
lets see: https://www.autohotkey.com/boards/viewtopic.php?f=86&t=94678