Ok, I remember this being worked out a while back in this thread here.
TL;DR
It was a little tricky for everyone to figure out, and it has some quirks.
There’s a slight delay when activating holdLayer mouse, and tapKey escape. If it feels weird, you can tweak the timing by adjusting the timeoutIn 150 on the first line. Also, you get stuck on the Mouse layer when using the double-tap to lock, so you’ll need a second macro to untoggle the Mouse layer.
The first macro goes on your Base layer’s mouse (CAPS) key (assuming that’s where you want it):
ifGesture timeoutIn 150 $thisKeyId final toggleLayer mouse
ifHold final holdLayer mouse
tapKey escape
and the second macro goes on the Mouse layer’s mouse key to un-toggle the locked layer:
Thank you @pcooke9 and @kareltucek . I appreciate the comments. Agent isn’t able to load my keyboard’s config (“Hang tight” forever), so I am unable to try your suggestions out.
A quick note before I file an issue on GitHub: … I do not want escape to fire on the doubleTap that locks the mouse layer. Hopefully the intent is clear. If not, I can go into detail later.