Insert Text by Typing Works Sometimes and Sometimes Not

Sometimes Keyboard Maestro enters text correctly and sometimes it misses the first character. I added a pause before entering the text for 1.5 seconds, thinking that maybe it was just moving too fast. It seemed to improve the accuracy, but it still often misses the first character. I've tried adding an extra character in front of the text, but then sometimes it adds that.

What is your use case? Is there a reliable way to reproduce it?

Sorry, I should have supplied more specific information.

I’ve changed it since it wasn’t working. What I had was to periodically enter a password into an application.

  • Activate an application.
  • Pause for 1.5 Seconds.
  • Enter text by typing. (only text added in the box - no token)
  • Type the Return Keystroke.

I’ve changed it to paste from the clipboard instead, which has fixed the text problem but it’s not a real solution either. I want this to happen periodically rather than by hot key. The problem is if I’m using the mouse at the time the macro launches, it doesn’t complete the action.

1 Like

If you could post your macro perhaps we could offer better suggestions.

See

1 Like

You may be experiencing this issue:

https://wiki.keyboardmaestro.com/Troubleshooting#Sometimes_Typing_in_Password_Fields_Drops_Characters

Sometimes Typing in Password Fields Drops Characters

When Keyboard Maestro simulates a keystroke, it simulates both the press and the release. If the key is already being held down by you (eg because you pressed the key as a trigger), then Keyboard Maestro notices this, and first releases the key, and then presses and releases the key.

However, in a password field (or any time Secure Input is enabled), Keyboard Maestro and other applications cannot see the state of the keyboard (for obvious security reasons). Because of this, Keyboard Maestro does not know that you are still holding down a key and therefore cannot know to release it. So if it tries to simulate the same key that you are holding down, in a password field, it will still simulate the press and release, but because the key is already held down, the press will not do anything and the keystroke will be lost.

This happens most commonly when you have a hot key trigger with the same key (eg Control-T) as a key you want to type in to a password field (eg “Hello there”). Because it is a password field, the only indication will be a missing bullet (•) (so ten instead of 11 bullets) and then an “invalid password” error, which makes this problem hard do diagnose.

I have the same problem.

I've read the article but they don't explain how to fix the issue... Or maybe I misread?

Does anyone can enlighten me? Thank you!

One thing you can do is to begin the macro with a "Pause Until" action. For that action, add a key condition for each key involved in the trigger (e.g., the command key and the T key). For each of those conditions, set it to "key is up". Also, set the action to "All of the following". That way, upon triggering the macro, nothing will happen until you have let go of all of the keys that triggered the macro.

1 Like

Relatedly, every time I use a "Pause Until Key Whatever Is Down" in my macros, I follow that action immediately with a "Pause Until Key Whatever Is Up" action to avoid problems.

1 Like

Smart! Will try that.
Thank you for your help kind sir !

It didn't solve the problem unfortunately.

The text I'm trying KM to type still misses its first letter... :confused:

At least that tells you that the problem is NOT interference with trigger keys.

I figured.

The first letter of the text (in this case E) was a capital letter and it interfered with another shortcut triggered by "SHIFT E".

If it can ever help someone...