Create a system key event, such as a media, volume or brightness key.
Posting these behaves like pressing the key on an Apple keyboard, so media keys are routed
to whichever app macOS considers to be playing (including audio in a browser tab).
Synthetic brightness keys are ignored by some Macs and external displays; use hs.screen
to set brightness directly if they have no effect.
Parameters
key: string
A system key name from hs.eventtap.systemKeys (e.g. "PLAY", "SOUND_UP"), case-insensitive
Create a system key event, such as a media, volume or brightness key. Posting these behaves like pressing the key on an Apple keyboard, so media keys are routed to whichever app macOS considers to be playing (including audio in a browser tab). Synthetic brightness keys are ignored by some Macs and external displays; use
hs.screento set brightness directly if they have no effect.