Best suggestion I have is to open a github ticket and try to talk me and Laszlo into allowing saving scancodes into registers and using them in SHORTCUT parameters… …the trouble is that those commands take shortcuts, which is one grade more general concept than a single numeric scancode.
Also, these are not KEYIDs (integers identifying physical positions on keyboard), they are SHORTCUTS (aka scancodes, possibly accompanied with modifier masks).
Thinking about this a bit more, there is this dark magic: activateKeyPostponed [atLayer LAYERID] KEYID which allows you to induce key activation from different layer, so you could map the f1-f12 in (e.g.) fn2 layer at corresponding locations, and then 1-10 in yet another layer and have:
This looks interesting, although I am not sure if it worth the hassle. (I will wonder what these extra layers do, when I look at my configuration after 6 months.)
But I will try it, perhaps it useful for something else.
Regarding your comment, my idea was to convert a KEYID to a scancode symbol.
In (probably incomplete) pseudo code:
scancode = null
if #keyid between 65 and 70:
scancode = #keyid - 64
else if #keyid between 0 and 5:
scancode = #keyid + 7
ifPlaytime 199 final tapKey ("f" + scancode)
tapKey scancode
I have only skipped over your other thread, but imho KEYID and scancode symbols get easily confused by people which do not exactly know the in and outs of a keyboard. (aka new customers, and also people like me which write their macros and then forget about them, because they are working.)
With the 10.3 firmware update, I revisited my question and I think the arithmetic part is now possible.
The part which is missing, is that tapKey expects a SHORTCUT, but I can only provide a STRING.
which is not valid because: Unrecognized key abbreviation: "$scancode"
I get that a conversion from STRING to SHORTCUT does not exist, as it is a cast which might fail which would result in runtime errors.
(I do not think macro runtime errors are possible at the moment, or are they?)
Macro runtime errors are possible. For instance non-existent goTo target will generate one.
The way you suggest using the syntax is not entirely unreasonable, but it is not implemented at the moment, and poses a number of technical issues that I am not sure I can justify.
The suggestion to use the activateKeyPostponed [ append | prepend ] atLayer <layer> <keyId> still applies.
Just for a short clarification, my current setup is not bothering me.
I just wanted to try the new conditions and arithmetic operations added with 10.2 and 10.3.
I am quite impressed that they were added to the macro syntax, because the macros are now nearly a full programming language.
I want to try this dark magic too. Thanks @kareltucek , I was wondering how to do something like this, but it wasn’t clear in my mind to ask for this, and now I find it, the forum is great.