Sometimes Focus Doesn't Move to List Prompt

Hi, all. I am a very new user to KM so I apologize if I'm overlooking something simple here, but one of my first macros that is more than just "activate application" or "resize application" is to present a 'Prompt with List from Text' window which then performs the 'Insert Text by Typing' action. This is to make entering certain low sensitivity passwords (for lab equipment and so forth) at my job a bit easier, nothing actually critical goes in this list.

The problem I am running into is that sometimes keyboard focus moves to that list just fine and other times it stays on the password entry field where I triggered the macro. Some applications never move focus and I always have to click into the list first (such as SecureCRT) while others will occasionally move focus to the list, but not always (Chrome). I'm even having certain applications move focus to the list and then go back to the wrong window of the application, such as TextMate if two windows are open.

I have tried using this macro that I found to automatically move focus to the list, but I receive the error in the picture attached.

I know that focus macro is very old so maybe it just needs some tweaking, but before I go digging too far into this I wanted to ask if I'm overlooking something simple? Or is there a suggested approach I should take? Not looking for anybody to do the work for me, but I do feel like I could use a push in the right direction.

Thanks in advance for any assistance you can provide and if I have left out anything important please let me know and I'll update.

Password Prompt (Sanitized).kmmacros (3.6 KB)

So I've done some more testing with this and tried a few different ways to trigger the password entry and at this point I feel like the problem is coming from the password field itself. I'm by no means a programmer so not sure what this would be caused by or even how to search for it. Is there a commonly used function in web design that prevents focus from being shifted away from a password entry field?

One example of the focus getting "stuck" inside a password prompt is on a help desk site I use that's built on Zendesk. If I click in the password prompt and try to access my "Prompt by list" or a macro palette then I have to click the mouse on the selection I want, the cursor is still in the password field by default. However if I activate either entry method in the username field of that same Zendesk site or in this text entry field where I'm typing this post it automatically moves to the palette or list prompt.

Edit: Using Developer Tools I found that it's definitely tied to the input field being labeled as a "password" field. If I change it to a text field it works fine.

I see other reports where entering text into a password field fails. I should note here that it does enter the text correctly if I click the entry in the list or macro palette, it's only the need to use the mouse that I'm trying to work around.

I don't mean to keep bumping this post, but I did find a workable solution.

After some tinkering I finally found that if I create a macro group, activate the group as a palette via hotkey, and then assign triggers to the various macros that include modifiers it will trigger and input the text while inside the password field without having to use the mouse or deal with focus issues. If the trigger on the individual macros does not include a modifier it will not leave the password field, it will just type the trigger inside the password field and leave the palette up, waiting on a mouse selection.

I also found that this only works if I directly trigger the macro group and select from there, if the palette is called by another macro the same modifier+number trigger won't work, it still just types the number in the field.

Below is what actually works:

I'm going to mark this as solved considering I found a way to get to my desired behavior, but I'd really like to understand why it doesn't work if the palette is called by another macro and why it requires a modifier. Any insight is appreciated!

Edit: The second step where PalPassFN is being set was for debugging purposes, it's not vital to the function of the macro. Should've removed it......

1 Like