keyboardLayout
Returns the name of the current keyboard layout.
Keyboard Maestro: KeyboardLayout
Details #
keyboardLayout() takes no arguments and returns the localized name of the current input source, such as U.S. or Dvorak.
Parameters #
Takes 0 arguments.
{{ keyboardLayout() }}
Examples #
keyboardLayout()→
keyboardLayout() == "U.S."→
falseGotchas #
The name is localized, so compare against what your Mac reports, not a fixed English name.
Calling it with any argument is an error:
keyboardLayout() takes 0 arguments, got 1.When no real Mac is behind it (tests, previews) or the Mac can't answer, it returns empty text.