A macOS menu bar app that forwards media keys (play/pause, next, previous) to a specific media application of your choice.
This is a modern replacement for Mac Media Key Forwarder, designed to work with macOS Sequoia (15.x), Tahoe (26.x), and later.
I find macOS’s media key handling behavior mildly infuriating. When I hit play/pause on my keyboard I just want it to toggle playback in whatever music streaming app I'm listening to. I never want it to launch Apple Music. I never want it to pause the video I'm watching. Just pause or resume music. That's it. Nothing else.
But that's not what happens, and while I understand why it does what it does, I'm frequently surprised and annoyed by it. And that's what this app tries to fix. Bind the play/pause and prev/next keys to a specific app of my choosing.
Full disclosure: I am a professional developer but I am not a macOS/Swift/Obj-C developer. This is 100% vibe-coded except where contributions from others are involved. (Thanks, @polderleo!)
- Intercepts media keys and forwards them to your chosen app
- Prevents Apple Music from hijacking your media keys
- Built-in support for Spotify and Apple Music
- Add any custom media app via "Configure Apps..."
- Menu bar icon for easy access
- Remembers your selected app between launches
Download the latest release from the Releases page.
brew install --cask rayhatfield/mac-media-keys/mac-media-keysTo update later:
brew upgrade --cask mac-media-keys- Download
MacMediaKeys.zipfrom the latest release - Unzip and drag
MacMediaKeys.appto your Applications folder - Grant Accessibility permission when prompted:
- Click "Open System Settings" or go to System Settings → Privacy & Security → Accessibility
- Enable MacMediaKeys
- Restart the app after granting permission
The app also checks for new releases automatically and will prompt you to download an update when one is available (this can be disabled in Settings).
- Click the music note (♪) icon in the menu bar
- Select your target media app from the list
- Press media keys on your keyboard - they will be forwarded to the selected app
- Click the menu bar icon
- Select "Configure Apps..."
- Click "Add App..." and select any .app file
- The app will now appear in your target list
- macOS 13.0 (Ventura) or later
- Accessibility permission (required to intercept media keys)
# Clone the repository
git clone https://github.com/rayhatfield/mac-media-keys.git
cd mac-media-keys
# Build with Xcode
xcodebuild -scheme MacMediaKeys -configuration Release build
# The app will be in:
# ~/Library/Developer/Xcode/DerivedData/MacMediaKeys-*/Build/Products/Release/MacMediaKeys.appIf you want to install and run a local debug build instead of the release zip:
xcodebuild -scheme MacMediaKeys -configuration Debug buildThen install the built app:
- Open
~/Library/Developer/Xcode/DerivedData/ - Find
MacMediaKeys-*/Build/Products/Debug/MacMediaKeys.app - Drag
MacMediaKeys.appto your Applications folder - Launch it and grant Accessibility permission in System Settings → Privacy & Security → Accessibility
If you already have a release build installed, replace it with the Debug build so macOS is launching the version you expect.
The app uses CGEventTap to intercept system-defined media key events before they reach other applications. When a media key is pressed, the app sends the corresponding command to your selected media player via AppleScript (for supported apps) or direct keystroke injection (for other apps).
Key technical details:
- Intercepts both key-down AND key-up events to prevent
mediaremotedfrom launching Apple Music - Uses
NSApplicationActivationPolicyAccessoryfor Sequoia/Tahoe compatibility - Falls back to spacebar/arrow key injection for apps without AppleScript support
This app requires Accessibility permissions to intercept and consume media key events. Mac App Store apps must be sandboxed, and sandboxed apps cannot request Accessibility permissions. This is why similar apps like BeardedSpice are also distributed outside the App Store.
MIT