hammerspoon2-docs
    Preparing search index...

    Function create

    • Create a hotkey without enabling it cmd / command / , shift / , alt / option / , ctrl / control / .

      Parameters

      • mods: string[]

        An array of modifier key strings (e.g., ["cmd", "shift"]). Supported names:

      • key: string

        The key name or character (e.g., "a", "space", "return", "f1")

      • callbackPressed: (() => void) | null

        A JavaScript function to call when the hotkey is pressed, or null for no callback

      • callbackReleased: (() => void) | null

        A JavaScript function to call when the hotkey is released, or null for no callback

      Returns HSHotkey | null

      A hotkey object, or null if creation failed. Call .enable() to activate it.