hammerspoon2-docs
    Preparing search index...

    Function keyboardCapsLockState

    • Checks a specific keyboard's own CapsLock LED state. Unlike capsLockState(), this queries the individual keyboard identified by keyboardID (from attachedKeyboards()), reflecting how modern macOS tracks CapsLock independently per physical keyboard.

      Parameters

      • keyboardID: number

        A keyboard identifier, as returned by attachedKeyboards()

      Returns boolean

      true if that keyboard's CapsLock LED is on, false if it is off, unavailable, or the keyboard was not found

      Requires Input Monitoring permission — see hs.permissions.requestInputMonitoring().