Prompt For User Input (how to get keyboard focus)

Hello,

My snippet pops up a Dropdown List (I’m using ‘Prompt For User Input’). What I’d like is for the Dropdown List component to have initial focus. The will allow the user to use the up/down arrows to select an item, and complete the whole process using just the keyboard, rather than have to mess around with the mouse.

In practice the OK button has initial focus, the TAB key doesn’t tab to the Dropdown List … or the CANCEL button, and even if I select the Combobox with my mouse, I still have to press the up/down arrows several times before they start actually selecting items.

I’m new to KM so I’m wondering if this could be a bug in V7, or perhaps there is a better way to create a Dropdown List?

Thanks, in advance :]

Nope. This is why I've ended up relying on increasingly complex custom HTML prompts for pick lists.

2 Likes

You may need to change your settings in System Preferences > Keyboard > Shortcuts

This works for me, completely using the keyboard:

  1. Text box has initial focus
  2. TAB to move to dropdown list
  3. to open list, and move down the list
  4. to select the item I want

4 Likes

Thanks iNik :slight_smile:

@JMichaelTX Thanks, really useful to know, and my settings are indeed set to Textboxes and Lists only! What’s confusing me slightly is I’ve never had this issue with programs like TextExpander which tabs between Dropdowns, no issue - (I can only hazard a guess that perhaps TE is using some kind of HTML interface but KM is using a system dialog box and therein lies the difference?!). Great tip though!

@@JMichaelTX I’m running in to a problem so i wonder, is it possible to look at your macro? I can now tab between all items (great), and pushing the down arrow when the Dropdown is selected opens it up, but it does not allow me to move through the items. Very, very occasionally it starts working (odd as no other programs give me the slightest issue using key-commands), I’m a bit curious as I can clearly see it working in the gif you posted!

I've noticed this behavior with the arrow keys myself occasionally. I'm not sure whether this is an issue with KM, or something else.

Maybe @peternlewis can jump in and advise us.

Unfortunately, this is more the domain of the system. It seems sometimes to allow keyboard navigation and sometimes not.

Thanks Peter. I’m loving Keyboard Maestro and will definitely be swapping over from TextExpander at the end of the month. I thought it may be worth mentioning that I do not experience any of these tabbing or selection issues when using TextExpander’s user inputs, so I guess they are generating their forms differently? I just wondered whether a similar out-of-the-box method could be on the cards for Keyboard Maestro down the line? Thanks.

No idea, it is presumably caused by very subtle differences in the way the windows are displayed, or the kind of application Keyboard Maestro Engine is, or something.

This is another area where a Custom HTML Prompt can potentially make your life easier with the “autofocus” attribute on form elements.

`

Volvo Saab Opel Audi `
1 Like

I am new to KM and I find is strange that TextExapnder has not problems with option selection and does not require any changes to be made to keyboard settings.

Perhaps this can be fixed under the hood in KM?

As stated above, if I knew of a way to fix this, I would. It is the system that controls the behaviour of the tab key, and if it is not behaving I don’t know of any controls I have over it I’m afraid.