; PROGRAM SPECIFIC HOTKEYS ; -> Template for window-context-aware hotkeys. Different shortcuts activate depending on which app is in focus. #Requires AutoHotkey v2.0 #SingleInstance Force SendMode("Input") SetWorkingDir(A_ScriptDir) SetTitleMatchMode(2) ; ================================================================== ; CONTEXT 1: ALWAYS ACTIVE (global — runs regardless of which app is in front) ; ================================================================== ; Put hotkeys here that should work everywhere — media key overrides, ; clipboard helpers, global shortcuts, etc. ; Example: ; ^!n::Run("Notepad") ; ================================================================== ; CONTEXT 2: ABLETON LIVE ONLY ; Active when Ableton (or an Ableton plugin window) is in focus ; and Melodyne is NOT open. ; ================================================================== #HotIf ((WinActive("ahk_class Ableton Live Window Class") or WinActive("ahk_class Vst3PlugWindow") or WinActive("ahk_class AbletonVstPlugClass")) and not WinActive("Melodyne")) { ; Your Ableton-specific hotkeys go here. ; Examples: ; F1::AddTaggedPlugin("AutoHotKey", "Compressor", 0) ; ^!b::Send("^!b") ; toggle browser } #HotIf ; ================================================================== ; CONTEXT 3: ABLETON IS RUNNING (even if it is in the background) ; Useful for media-key MIDI control that should work from any window ; as long as Ableton is open somewhere. ; ================================================================== #HotIf WinExist("ahk_class Ableton Live Window Class") { ; Your "Ableton exists" hotkeys go here. ; Examples: ; Media_Play_Pause::SendMidiNote(1, 6, 127) ; Volume_Down::SendMidiNote(1, 4, 127) } #HotIf ; ================================================================== ; CONTEXT 4: BITWIG / CUBASE (if you use multiple DAWs) ; Active when Bitwig or Cubase is in focus. ; ================================================================== #HotIf WinActive("ahk_class bitwig") { ; Your Bitwig-specific hotkeys go here. ; Example: horizontal scroll with Shift+Wheel } #HotIf #HotIf WinExist("ahk_exe Cubase14.exe") { ; Your Cubase-specific hotkeys go here. ; Example: settings window toggle ; $^,:: { ; if WinExist("Preferences") ; { ; Send("o") ; return ; } ; else ; { ; Send("^,") ; return ; } ; } } #HotIf ; ================================================================== ; CONTEXT 5: NON-ABLETON (active when Ableton is NOT in front) ; Useful for global shortcuts that should not be active in Ableton. ; ================================================================== #HotIf !WinActive("ahk_class Ableton Live Window Class") { ; Your "Ableton is not active" hotkeys go here. ; Example: restore Ctrl+Shift+Wheel as system volume ; ^+WheelUp::Volume_Up ; ^+WheelDown::Volume_Down } #HotIf ; April 2026 — Released under MIT license by Yannis Lever ; This code is provided as-is with no warranty. Use at your own risk. ; Check out www.livehack.tools for more LiveHacks!