hammerspoon2-docs
    Preparing search index...

    Function makeSystemKeyEvent

    • 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

      • isDown: boolean

        true for key down, false for key up

      Returns HSEventTapEvent | null

      An HSEventTapEvent, or null if the key name is unknown