Wrong keyboard layout after sleep

The KM engine seems to not adjust to the current keyboard layout under some combination of events involving sleep/wake and changing the keyboard layout. (maybe network connectivity check issues again?)

  • launch engine with keyboard layout 1 (eg qwerty)
  • change keyboard layout to layout 2 (eg dvorak)
  • close laptop for a while (maybe move to different wifi area?)
  • open laptop

Now the typed string triggers don’t work. Quitting and relaunching the engine fixes it though. Sorry I haven’t yet nailed down the minimal steps to reproduce consistently, but there’s definitely something going haywire. Perhaps also disconnecting USB keyboard is related?

KM 7.0.2
OSX 10.11.1

I hit this issue this week and tore my hair out trying to figure out what was happening to my trusted macro ( since the typed field was a password field and I couldn’t see the typed string) . Is there any way to force a layout for typed strings? FWIW, restarting the KM engine made it pick up the correct layout and the world was a happy place again.

No, there is no way to force the layout.

Keyboard Maestro checks the layout for changes every five seconds (well, any time it is required and more than 5 seconds have elapsed).

If it gets out of sync regularly, you can turn on debugging for the keyboard layout code with:

defaults write com.stairways.keyboardmaestro.engine Debug Keycode

And relaunching the Keyboard Maestro Engine and perhaps see what is going on.