Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save supersaiyansubtlety/cceabd8986035abf91f15b1112bb4d77 to your computer and use it in GitHub Desktop.
Save supersaiyansubtlety/cceabd8986035abf91f15b1112bb4d77 to your computer and use it in GitHub Desktop.
No global hotkey in app AHK
#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