π Introduction
A tiny Node library that posts macOS system media keys to whichever app is playing.
@kud/macos-media-keys exposes one async function, sendMediaKey, that fires the same system events as the media keys on a Mac keyboard. Whatever app currently owns media focus (Music, Spotify, Qobuz, a browser tab) reacts as if you had pressed the physical key.
For a ready-made command line, see macos-media-keys-cli.
What's here
- ποΈ Usage β the
sendMediaKeyfunction, the five key names and how failures surface - π Permissions β the Accessibility grant, which process needs it and how to fix a rejection
- βοΈ How it works β the Swift helper, lazy compilation, the cached binary and platform requirements