Created
March 9, 2019 07:39
-
-
Save supersaiyansubtlety/cceabd8986035abf91f15b1112bb4d77 to your computer and use it in GitHub Desktop.
No global hotkey in app AHK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#SingleInstance force ;if there's already an instance of the script, replace it | |
#NoTrayIcon | |
;use name of executable or any other window title mentioned here https://autohotkey.com/docs/misc/WinTitle.htm | |
targetProcess := "ahk_exe atom.exe" | |
;Hotkey to capture here. As far as I can tell you have to use this method of specifying hotkeys here (! + ^ # Space Enter etc...) | |
;https://autohotkey.com/docs/Hotkeys.htm | |
$!Space:: | |
if (WinActive(targetProcess)) | |
{ | |
;As far as I can tell you have to use this method of specifying hotkeys here ({KeyName}) | |
;https://autohotkey.com/docs/KeyList.htm | |
ControlSend,,{Blind}{Alt}{Space}, % targetProcess | |
return | |
} | |
else | |
{ | |
;Same hotkey as above, so it's send as normal when not in targetProcess | |
send,{Blind}{Alt}{Space} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment