hammerspoon2-docs
    Preparing search index...

    Function addWatcher

    • Registers a listener that fires whenever the keyboard input source changes. The listener is called with no arguments. Read currentLayout(), currentSourceID(), or map inside the callback to inspect the new state. The OS subscription starts lazily on the first listener and is released automatically when the last listener is removed via removeWatcher.

      Parameters

      • listener: () => void

        A function called when the input source changes.

      Returns void