The action, below, is one we've used for a couple years. In previous versions of KM it could be set by simply typing the first characters of a given line (without even clicking the pulldown menu). Since updating to KM 10 that no longer works. I also notice we can no longer type "Space Bar" to trigger the "Cancel" button in KM Prompts. I assume this is related. Is this a known issue?
I can't speak with any authority as to your first issue, but for the space bar issue you can append your Cancel text as show in the example below (you don't actually need the (SPC) but, I just always put that in as a visual cue to what the keyboard shortcut is for each button).
Note that there is an actual space in front of the forward slash for the cancel option.
My experience is that the default button is ALWAYS triggers by "Enter" or "Return". And, until KM 10 Space Bar ALWAYS triggered Cancel.
Your example does not work for me. I typically add a shortcut to a specific button with
Button/b.
Editing the Cancel button to read "Cancel/c" does allow it to cancel with "c" keyboard character. But I really liked the default "SpaceBar" functionality.
The problem with adding a "/" after "Cancel" is that it loses the default status of the other button.
Hmmm.... that's odd BUT I have been using custom appended buttons for so long I don't really know much about the default behavior. Looks like @Zabobon is replying though, so he'll likely know more (seems like he and I are always replying at the same time ).
Hi @rcraighead I think the reason the example you posted doesn't cancel when the spacebar is tapped is the it is waiting for input for the Variable "Digit". Any key you type will only highlight that field.
I can confirm that "Return" still works for OK and "Spacebar" still works for Cancel in KM 10.0.2
Thanks, @Zabobon. Can you confirm that typing the first characters of one of the pulldown menu line items does "NOT" open and select the line? This no longer works for me in KM 10. It was a nice feature of earlier versions.
"SpaceBar" no longer works on ANY KM 10 Prompts. It was standard using the same macros in KM 9.
Yes, the default (blue) button still triggers with "Enter" or "Return". That has not changed.
@Zabobon, this is not how the same action worked in KM 9. Before KM 10 I could start typing and the line item would be selected, then typing "Return" or "Enter" would close the Prompt. It was a beautiful thing.
That still works for me.
macOS Monterey 12.1 KM 10.0.2
1) Prompt with no dropdown or highlighted field (in effect it is the Cancel button that has the blue highlight around it)
Return key, for OK
Spacebar, for Cancel (if that is the button with the blue highlight around it).
Esc, for Cancel - if you name the buttonCancel/.
2) Prompt with dropdown
EDIT: Type first letter selects item in dropdown list (after a slight pause as @drdrang noted in the following post)
Arrow key down, to select list and then you can type first letter to select
Spacebar, to select list (as that is the item with the blue highlight around it) and then you can type first letter to select
Return to accept the choice
Return key, for OK
Esc, for Cancel - if you name the button Cancel/.
I'm using KM 10.0.2 and typing characters after the window appears does select a menu item, but there is a pause before that happens. Also, typing the down arrow key cause the menu to open up.
I am still running Big Sur, so that may be the reason it works for me.
Also, I believe spacebar is like tapping whatever item is currently selected (has a ring around it), which is not necessarily the Cancel button. Escape and Command-Period are synonyms for Cancel.
Ah, that's interesting. So, the reason Spacebar works to cancel in my test is that the Cancel button had the blue highlight around it. In the second one with the dropdown Spacebar selects the dropdown because that is the item with the blue highlight around it. I suspect this is standard Mac OS behaviour and not particular to Keyboard Maestro?
And also interesting that just typing the first letter does select the item (after the slight pause). In trying to answer this I've learnt new things too!
Well, that's hopeful. In my experience, the "Default" button (blue button) is the top button defined in the prompt action unless it is assigned a shortcut.
Yes, when it was working, there WAS a short pause after typing before the menu item was selected.
Yes, if I manually open the dropdown, then I can type to select a line, but this was not necessary in KM 9. Just typing the 2-character prefix selected the correct line without opening the dropdown.