AFUHK & AWUHK ModesšŸ˜‰

The new $onJoin and $onSplit macro events have some nice usecases…

Thanks to @euan.buchanan for the idea to use the merge sensor for macro actions. I was going to say that can’t believe it wasn’t suggested a long time ago, but while troubleshooting, I saw this GitHub issue from a couple years ago. :slightly_smiling_face:

And of course, thanks to @maexxx & @kareltucek for their brains. :smiling_face:

Here’s some examples for locking/sleeping the UHK by joining the halves together:

AFUHK Mode
I use this if I’ll be Away-From-UHK for a while.
(I also mutter something kinda like ā€œAFUHKā€ under my breath when I find myself typing on a non-UHK board. :smirking_face:)

The following will disable BLE/advertising, put the PC to sleep, and lock the UHK80:

$onJoin

set bluetooth.alwaysAdvertiseHid 0
set bluetooth.enabled 0
tapKey systemSleep
powerMode lock

And then this will wake the UHK80 when separating the halves:

$onSplit

delayUntil 3000
powerMode wake

If you’ll be transporting the UHK80 (AWUHK Mode ā€œAway With UHKā€ :wink:), and want to put it to sleep instead of just locking it, then replace powerMode lock with powerMode sleep in the $onJoin event. Of course, if you use sleep mode, you’ll have to manually wake the halves by holding the S+F & J+L keys, instead of using the $onSplit macro in the above example.


It’s also probably a good idea to note that (depending on the merged/unmerged state) the $onJoin or $onSplit macro events will be triggered when the UHK is restarted. E.g., if you have tapKey systemSleep in the $onJoin event, it will put the host to sleep if the halves are merged when the UHK80 reboots (whether from a crash, or if the reset buttons on the back are pressed, etc.).

3 Likes