Parametrizable smart macros: brainstorm for future specification

When designing more complex macro scenarios, I’ve felt a few times that being able to pass a single parameter to a call command (basically, using a macro as a subroutine with one parameter) would be helpful.

Well, this would require general support for local variables. While it is generally a reasonable request, I don’t feel a strong need to have them.

(After all, you can pass arguments to call via global variables.)

Once that is possible, then the next logical step for me would be that every execution of a macro directly from a keypress (as bound by Agent) would get the KEYID or KEYID_ABBREV as the one parameter.

KEYID_ABBREV’s are just aliases for corresponding KEYID. I.e., from the point of view of the variable system, they don’t exist.

As for KEYIDs, the $thisKeyId virtual variable is available in every macro (of course except those that are not bound to activation keys.

I don’t understand how your suggestion would work with scancodes and not KEYIDs. When you bind a macro to a key, you are not assigning a scancode to it. So how would the macro invocation know which scancode?

It would be again accessed via a virtual variable from another layer. Something like $keyScancode.fn2.a, or maybe $keymapAction.fn2.a.scancode

Would we then need a function to convert KEYIDs to scancodes? But what table would this function use?

No.

I am not sure, @kareltucek, if this is helpful, because I seem to be the niche person, but it’s my opinion.

Thanks for it!

Right now I cannot think of the particular use cases where I had stumbled across this. I am sure I will come across them again, and then I can add them here.

If you do, please let me know!

2 Likes