I have a (at least i think) much simpler solution :)
#NoTrayIcon
ScrollLock::
Input, Key, ,{Enter}
Send, {%Key% Down}
return
You press ScrollLock (which I doubt you use for anything else, otherwise set it to a free key), and then enter the name of button to be held down.
- If you want to hold down a single character, you just write it in.
- For other keys you can find the names here: http://www.autohotkey.com/docs/KeyList.htm
- Mouse: LButton for left, RButton for right and MButton for middle
You end the input with the Enter key, and after that the program will hold down the entered key.
If you want to "lift up" the key, just simply press it once, and it will be held down no more. :)
ps.:I have #NoTrayIcon, because I'm running it permanently in the background, but if you wanted to be able to exit then simply add something like this:
F12::
ExitApp
return