hammerspoon2-docs
    Preparing search index...

    Function on

    • Register a listener for Bluetooth events.

      Parameters

      • event: "connected" | "disconnected" | "powerChanged" | "discovered"

        The event to listen for

      • listener: (arg: boolean | HSBluetoothDevice | HSBluetoothPeripheral) => void

        Called with the event's device or peripheral, or for "powerChanged" the new power state

      Returns void

      Throws an Error on failure; wrap calls in try/catch to handle it.