I have an odd situation that I’m not sure how to solve, at least not efficiently. Specifically I want it so when I press the left control on the keyboard, it enables a different layer which replaces the 1, 2 and 3 keys with macro 1, 2 and 3 respectively, but otherwise passes everything else through normally. I also/still want the left control to register as pressed too so I can still use the left control key in key combinations.
Now that part is relatively easy to set up. I add two mappings for the left control key; one for the pass-through and one to enable the layer with the macros on it.
That works mostly as expected but with one unintended consequence… when the macros execute, they are executing with the left control key registering as still being held down (because it is!), meaning for instance if my macro types the the word ‘welcome’ the computer actually receives command-w and instantly closes the window with the focus.
Now the only way I can think to address this is to still map the left control key to trigger the layer, but not map it through. Then using expressions, if that layer is active and one of those three macro keys are not pressed, set a register, then add a mapping for that register to trigger the left control key.
There may be some timing issues there however depending on if you process the expressions before or after you process the mappings. If expressions are processed first, this will work. If mapping are processed first, then I would have to use three more registers to trigger the macros rather than the mappings as that way I could control the order of things.
Now in a perfect world, there would be a setting saying "when executing macros, temporarily disable/release any currently-pressed modifiers (any pressed keys actually) then reset them after the macro is finished executing (or reset things when all keys are released.) This way the macros would execute unencumbered but the keyboard would otherwise function as expected.
Normally I would look into the firmware and try implementing this myself, but the firmware I’m using is your classic Bluetooth ‘beta’ one which you haven’t released the source code for (yet?) so I’m kind of stuck.
Can you think of a different way to solve this?