I'd also like to know if it's possible to do that. But as I understand it right now, with KM you don't ask a user for a character of input, rather you let the key be the trigger for a macro. The macro I screenshotted in the post that you linked contains an image of the trigger that you would need to use. If you do that, you can access the value of the keypresses using the %TriggerValue% token. It's a different way of thinking, and may require you to rewrite your code.
A loop requires to know when to stop. When are you planning to stop the repetition you speak of?
@Sleepy made some suggestions for how to improve my macro that may make it faster and simpler and also may help avoid the glitch/error that I described at the end. I'll let you know when I update it, which should be in just a day or two.
The answer may depend on whether we're asking about ascii keys or USB key codes. I'm not sure which one is more desirable to have, nor am I sure which one is easier to implement. I'm inclined to choose the latter, but then if we want to know which character was pressed (via ActionResult?), then the result would likely end up being strings like "CTRL-CMD-F10". If we chose ascii keys then the result could be a single character.
Keyboard Maestro cannot detect all keys without either setting hot keys, or them producing key events, neither of which is practical or sufficiently generic.
If you mean using built-in KM triggers, without a complicated KM macro to make it work, the answer is no.
If you mean could KM be modified to support this: while it seems to go against KM's design philosophy, I'd say the answer is maybe.
If you mean can you write a macro to emulate multi-key triggers, then I think yes. I could probably write a macro to emulate multi-key triggers. But I don't understand your question because CMD is a modifier, not a hotkey-capable key or an ASCII character. I think you would need to clarify by saying what kinds of keys (and how many) you want to be able to use in your multi-key shortcuts. If you tell me the exact, complete set of multi-key shortcuts you want to support, I'll tell you if I can emulate this in a set of macros. I'm pretty good at coming up with solutions to difficult problems like this one. But you probably won't like my solution because it will require work.
Thanks for your clarification! I thought that it would be option 3 and after some thinking I remembered a macro of @cdthomer where several hot keys can be used, and depending on the one that is used, a different action will be taken. (The Aspell macro)
Your code illustrates some of the things we would have to do to get multi-key hotkeys to work. If you're happy with this solution, we're all happy.
Actually, this sort of problem comes up so often, I've been thinking of a fancy new macro that handles all hotkeys including multi-key hotkeys. It would basically be a macro that intercepts all possible hotkeys, and using a dataset that the user prepares (probably a dictionary) it triggers the appropriate macro using a level of indirection. A user would probably set up hotkeys like this:
The main downside to this is that it would be the ONLY macro a user could use to set up a hotkey. If the user tried to set up any other macro to use a hotkey, then the KM palette would pop up, which cancels the automation. Basically I would be replacing KM's ability to process hotkeys with a single macro that emulates it. I'm not sure if people would want this sort of thing.
Okay, what about a means to report what key is down in the following case?
As far as I know there is no available method at present.
This would require quite a bit of set-up by the user when covering many keys, but it would offer a lot of functionality and could be reused once created.
No, there is no reporting on which condition of an “any” caused the condition to succeed. It doesn't really work in general, since for all/none variants there would be no specific matching condition, and for the others it could be one or more than match, and so the results would be indeterminate since they are all tested in parallel.
If you want to know this you have to expand it out to a While Loop and multiple If Then Else conditions.
I’ve updated my macro and I think it does what you want. When I use it I type shift + command + control + S and that pops up a Pick With List menu. The list is organized, as you have previously suggested, with a unique single letter at the beginning of every line.
Immediately before the PWL menu, I run Activate Macro Group for one action which activates a dedicated group. The group contains one macro, which has 48 triggers for the single action which outputs the trigger value followed by Return.
I tried that approach in my earlier version of "Follow Menu Choice With Return". It worked OK, but every once in a while the macro got interrupted, didn't run properly, and so didn't disable itself. That was awkward when then triggers were normal text characters.
My newer version puts FMCWR into a dedicated group that gets activated for one action only. That avoids the problem of how to disable the hotkey set.