Out of order keys!?

Note: I do not think this is a Keyboard Maestro Issue

I use Textexpander and KM (though I guess I could just use KM if that's the answer here), but I routinely have this issue where I'll be typing along and keys get typed out of order.

At first I blamed this on my MBP Touch Bar keyboard. However, it was happening this morning on my USB Das keyboard too.

I'll type a sentence like

"Hi there, Keyboard Maestro Users!"

and it will come out something like

"ih theer, Keybaord Maestro Uesrs!"

Very random flipping of keys. In order to get it to come out correctly when this is happening (note: not all the time...which I guess almost makes it worse!)

I have no reason in particular to suspect KM (or Textexpander), and Google searches have had really no results (maybe I'm not searching on the right thing.)

This issue happened on macOS High Sierra - and I think Sierra - as well as Mojave. Is this performance related? Is there some weird interaction between Textexpander and KM?

Before I try migrating all my Textpander snippets (open to a way to do that easily too), I was wondering if anyone else has had this issue.

I don't use TextExpander, but I use aText (which is a great replacement if you don't need the iOS version of TextExpander. It's $5 and has all the features of TextExpander on the Mac).

I am on High Sierra, and have noticed that when my system is under heavy load, I can get characters out of order, or I'll type stuff and nothing comes out at all. It's absurdly frustrating.

Do you have the 'expansion sound' enabled in TextExpander? That would tell you if something is triggering a TE snippet, although it doesn't really seem like this is a TE issue either.

Thanks for the tip on aText. I am loathe to escape TE for exactly that reason - the iOS TE keyboard gets used multiple times daily by me.

Absurdly Frustrating is exactly it. I wish I even knew where to start in trying to diagnose this. Since it doesn't happen all the time, it's not like I can even wipe all utilities out and add them back in. Sometimes I'll go days without the issue.

I don't even have enough information to try to report it to Apple. :tired_face:

First thing, next time it happens, check the Engine.log file (Help ➤ Open Logs Folder) and verify that no macros have fired unexpectedly. If not, then you can pretty much rule out Keyboard Maestro involvement.

Generally you get out-of-order keystrokes when an application tries to read the keys off the event queue, swallow them, and then add them back to the event queue. Keyboard Maestro does not ever do this for exactly this reason. You can get garbled results from Keyboard Maestro in a case where you use some combination of:

  • Typed String trigger.
  • Insert Text by Typing action (or simulated keystrokes).
  • You typing more stuff at the same time or some other expansion application expanding stuff at the same time

But you would see a macro firing in the Engine.log file in that case.

So my guess is you have some other software installed (probably other than Text Expander which I believe behaves the same as Keyboard Maestro in this regard) that is stealing keystrokes and resubmitting them.

To do this on a modern system the application presumably needs to have Accessibility permissions or to be something really low level like a keyboard driver or kernel extension.

Hrm… I'm not the OP, but now you have me wondering if aText is the culprit for when I've seen this happen. Next time I see it, I'll quit aText and see if that fixes it.

The only possibly questionable app (at least one that I really don't use) is Teacode. I removed that completely from my Mac. Maybe that's the cause. Pointing towards the Accessibility was a great help. I'm going to see if there are other apps to remove there.