The Computer Oracle

Bind commands to key-up and key-down in AutoHotkey

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Secret Catacombs

--

Chapters
00:00 Bind Commands To Key-Up And Key-Down In Autohotkey
00:30 Accepted Answer Score 4
00:49 Answer 2 Score 6
01:03 Thank you

--

Full question
https://superuser.com/questions/208389/b...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows7 #keyboardshortcuts #autohotkey #keybinding

#avk47



ANSWER 1

Score 6


You can accomplish the desired functionality with this code:

pause::
    fun1()
    keyWait, pause
    fun2()
return

If you are dealing with subroutines instead, use this:

pause::
    gosub, sub1
    keyWait, pause
    gosub, sub2
return



ACCEPTED ANSWER

Score 4


You could compile your .ahk scripts as .exe. Then have

Pause::C:\fun1.exe    
Pause Up::C:\fun2.exe

More info on .akh to .exe: autohotkey- ahk2exe